/// <summary> /// Stops the accounting operation and reports the measurement. /// </summary> public void Dispose() { var stop = Stopwatch.GetTimestamp(); if (!NativeMethods.TryGetThreadCycleTime(out var cycles)) { cycles = 0; } _parent.ChargeKernel(cycles - _cycles, stop - _start); }