public HighPerformanceTimer() { startTime = stopTime = duration = freq = 0; if (!DllImports.QueryPerformanceFrequency(out freq)) { throw new NotSupportedException("HighPerformanceTimer"); } }
public void Continue() { DllImports.QueryPerformanceCounter(out startTime); }
public void Pause() { DllImports.QueryPerformanceCounter(out stopTime); duration += stopTime - startTime; }
public void Start() { DllImports.QueryPerformanceCounter(out startTime); duration = 0; }