-
Timing in Windows
I have written C++ programs in DOS that use delay to provide millisecond timing accuracy with good results. I am now trying to write for the Windows environment, and I have been unable to find anything that will permit me to time events in the millisecond range. I understand that there are problems with accurate timing in the Windows multi-tasking environment, but I have used software that achieves accurate timing. How is it done? Borland C++Builder help and a variety of books appear to be silent on the issue.
Thank you,
Milton Steinberg
Marymount College, Tarrytown NY
-
GetSystemTime() for example, will work at millisecond accuracy.
>>> are problems with accurate timing in the Windows multi-tasking environment,
That is not a Windows specific problem, consider, a task issues a "get time" request, (any OS), which succeeds, but then gets swapped out for another task, it then gets swapped back and the last value retrieved, which is now wrong, is returned to the application.
-
QueryPerformanceFrequency and QueryPerformanceCounter
are suppose to be precise.
-
Hmm, the C clock() function should still work for you - no?