Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the Windows system time with millisecond resolution?

Tags:

How can I get the Windows system time with millisecond resolution?

If the above is not possible, then how can I get the operating system start time? I would like to use this value together with timeGetTime() in order to compute a system time with millisecond resolution.

Thank you in advance.

like image 770
axilmar Avatar asked Sep 16 '10 17:09

axilmar


People also ask

What is tick count in Windows?

GetTickCount function (sysinfoapi. h) - Win32 apps. Retrieves the number of milliseconds that have elapsed since the system was started, up to 49.7 days.

What is system's high resolution time?

4 High Resolution Time This specification defines an interface that provides the current time in sub-millisecond resolution and such that it is not subject to system clock skew or adjustments.

How are milliseconds measured?

A millisecond (ms or msec) is one thousandth of a second and is commonly used in measuring the time to read to or write from a hard disk or a CD-ROM player or to measure packet travel time on the Internet. For comparison, a microsecond (us or Greek letter mu plus s) is one millionth (10-6) of a second.


1 Answers

Try this article from MSDN Magazine. It's actually quite complicated.

Implement a Continuously Updating, High-Resolution Time Provider for Windows

like image 197
Kevin Gale Avatar answered Oct 15 '22 12:10

Kevin Gale