What would be a good way to measure sub-second elapsed time of native C++ code on Windows Platform(I am working on Windows Vista, Visual Studio 2010)
I have tried using
#include <ctime>
int main()
{
clock_t start = clock();
... some code
clock_t end = clock();
double cpu_time = static_cast<double>(end - start)/CLOCKS_PER_SEC;
}
but cpu_time
is always 0
.
Thanks !