namespace XFEExtension.NetCore.XUnit.Benchmarking; /// /// 抽象基准引擎使用的单调高精度时钟,便于替换真实时钟和注入确定性测试时钟。 /// public interface IBenchmarkClock { /// /// 获取时钟每秒产生的时间戳计数。 /// long Frequency { get; } /// /// 获取当前单调时间戳。 /// /// 当前时钟计数。 long GetTimestamp(); /// /// 将两个时间戳之间的差值换算为纳秒。 /// /// 测量开始时的时间戳。 /// 测量结束时的时间戳。 /// 两个时间戳之间经过的纳秒数。 double GetElapsedNanoseconds(long startTimestamp, long endTimestamp); }