I know this question has been asked few times over SO but none of them is really helping me out, so asking again.
I am using windows xp and running visual studio c++
If you're on Windows, the GetTickCount() function is a handy way to get a timer with more resolution than 1 second. The resolution of GetTickCount depends on your operating system, but it's probably somewhere between 10 ms and 16 ms.
Note that for quick operations, doing your code once won't be enough. Your code might run in like 0.02 ms, which means you'll get 0 from a counter such as GetTickCount. Your code may not execute for long enough for the timer to "tick" over to the next value. The solution is to run your code in a loop a million times or whatever, time the whole lot, then divide by a million.