esac
esac

Reputation: 24685

Windows API equivalent of Stopwatch::ElapsedTicks?

I am calling into an API that needs the elapsed ticks between 2 points. In a C# version, I use Stopwatch and utilize the ElapsedTicks method (this seems to be different than ElapsedMilliseconds obviously).

In Windows API I see GetTickCount(). However this seems to return the elapsed milliseconds, not ticks. How can I accomplish the equivalent with Windows API? (Prefer language agnostic since I might be writing a few wrappers for this).

Upvotes: 1

Views: 345

Answers (1)

to StackOverflow
to StackOverflow

Reputation: 124696

Stopwatch uses QueryPerformanceCounter internally, if it's available.

It determines if it's available by calling QueryPerformanceFrequency - the return value is also used to determine the frequency of the performance counter.

Upvotes: 1

Related Questions