mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-10-25 05:02:14 +00:00
32 lines
786 B
C#
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;
|
|
}
|
|
}
|
|
} |