How to get ticks from QueryPerformanceCounter in C#?

后端 未结 6 1072
不知归路
不知归路 2020-12-21 01:22

I need to replace Stopwatch to avoid using getters for its properties. I am going to implement it using QueryPerformanceCounter. I only need ticks nothing e

6条回答
  •  既然无缘
    2020-12-21 01:56

    http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.gettimestamp.aspx

    Stopwatch.GetTimestamp

    You don't have to instantiate a Stopwatch object, GetTimestamp should return the number of ticks regardless of its context.

提交回复
热议问题