Files
EightBitNet/EightBit.Benchmark/BenchmarkRegister16.cs
T
Adrian Conlon 9bfd65fbb1 * Update nuget packages
* Namespace z80 a little better
* Add some benchmarks
2026-10-24 21:41:12 +01:00

32 lines
786 B
C#

using BenchmarkDotNet.Attributes;
namespace EightBit.Benchmark
{
public class BenchmarkRegister16
{
private readonly Register16 _contents = new(0xde, 0xad);
private readonly Register16 _source = new(0xbe, 0xef);
[Benchmark]
public ushort Increment()
{
this._contents.Increment();
return this._contents.Joined;
}
[Benchmark]
public ushort AssignViaRegister()
{
this._source.Increment();
this._contents.Assign(this._source);
return this._contents.Joined;
}
[Benchmark]
public ushort AssignViaValues()
{
this._contents.Assign(0x01, 0x02);
return this._contents.Joined;
}
}
}