Turbo C++ time resolution up to milliseconds
The clock_t implications in time.h released with Turbo C++ v1.01 are good only up to 0.0545XX seconds, meaning any timing I want to do with higher precision is impossible with that library.
I was wondering if anyone knew a good library or method a开发者_如何学Cvailable to elder TurboC++ that I could use instead of time.h calls for better precision?
Is this the ancient Turbo C++ for DOS? I recognise that number as the ~1/18th of a second of the default DOS performance timer.
You can speed up the timer, but you'll have to write an interrupt routine that intercepts that timer and only passes on some of the interrupts. Or you'll get strange behavior from other parts of DOS. I have code for this somewhere which I may be able to dig out.
Use Windows QueryPerformanceCounter (and QueryPerformanceFrequency).
精彩评论