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

34 lines
768 B
C#

namespace EightBit.Benchmark
{
using BenchmarkDotNet.Attributes;
public class BenchmarkBus
{
private readonly SealedBus _contents = new();
[GlobalSetup]
public void GlobalSetup()
{
for (ushort i = 0; i < ushort.MaxValue; ++i)
{
this._contents.Poke(i, (byte)(i % 256));
}
this._contents.Address.Joined = 0;
this._contents.Data = 123;
}
[Benchmark]
public long Reading()
{
this._contents.Read();
return this._contents.Data;
}
[Benchmark]
public long Writing()
{
this._contents.Write();
return this._contents.Data;
}
}
}