Possible Duplicate:
C++ high precision time measurement in Windows
I am developing a program that downloads files from ftp, and am looking for a High-Res timer library to calculate download speed, for now I am using c++ time(NULL), but results aren't accurate.
Is there a simple/easy to use, plug N play kind of c++ library for windows platform ? Something that gives time elapsed in seconds since last call or something similar.
EDIT:
So the QueryPerformanceCounter() was mentioned many times, but going through other threads this is what I found out :
You should be warned that it is based on the CPU frequency. This frequency is not stable when e.g. a power save mode is enabled. If you want to use this API, make sure the CPU is at a constant frequency.
Be warned, though, that intel's SpeedStep technology may change the PerformanceFrequency without your code noticing
*We also tried fixating the thread affinity for our threads to guarantee that each thread always got a consistent value from QueryPerformanceCounter, this worked but it absolutely killed the performance in the application. *
So considering the situation is it advisable to use it ? The performance of the program and reliablity of the timer is very important