I have been looking for methods of measuring time in C programming.

With time.h, I can only measure in sec., which is useless in most cases.

I was then told about using ftime(), as demonstrated in this link:

http://www.phanderson.com/C/ftime.html

I am able to measure in ms with that function and I'm generally happy enough with it.

But then if I want to measure more accurately, in clock cycles with a programmed frequency, such that I maximize the performance of the processor, I was told to use QueryPerformanceCounter as described in:

http://support.microsoft.com/kb/q172338/#appliesto

with this function, I have trouble understanding. First of all, I don't think this is even C, or is it? Secondly, how do I use it in C code.

Or are there other ways to achieve the same task, using C?

I'd appreciate any help