How can I get the Windows system time with millisecond resolution?
Try this article from MSDN Magazine. It’s actually quite complicated. Implement a Continuously Updating, High-Resolution Time Provider for Windows (archive link)
Try this article from MSDN Magazine. It’s actually quite complicated. Implement a Continuously Updating, High-Resolution Time Provider for Windows (archive link)
Check out clock_gettime, which is a POSIX interface to high-resolution timers. If, having read the manpage, you’re left wondering about the difference between CLOCK_REALTIME and CLOCK_MONOTONIC, see Difference between CLOCK_REALTIME and CLOCK_MONOTONIC? See the following page for a complete example: http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/ #include <iostream> #include <time.h> using namespace std; timespec diff(timespec start, timespec end); int main() … Read more
There is nothing built into the .NET framework that I am aware of. Windows has a mechanism for high resolution timer events via the Multimedia Timer API. Below is a quick example I whipped up which seems to do the job. There are also seems to be a good example here. I will note that … Read more