GetSystemTimePreciseAsFileTime (kernel32)
Last changed: d.quinn1990@gmail.com-51.7.28.101

.
Summary
The GetSystemTimePreciseAsFileTime function retrieves the current system date and time with the highest possible level of precision (<1us). The retrieved information is in Coordinated Universal Time (UTC) format.

C# Signature:

[DllImport("kernel32.dll", SetLastError=true)]
static extern void GetSystemTimePreciseAsFileTime(out FILETIME lpSystemTimeAsFileTime);

VB Signature:

Declare Sub GetSystemTimePreciseAsFileTime Lib "kernel32.dll" (ByVal LPFILETIME lpSystemTimeAsFileTime)

User-Defined Types:

FileTime

Alternative Managed API:

The .Net Core CLR uses this API in the implementation of DateTime.UtcNow. To my knowledge the .NET Framework does not

Notes:

This function is best suited for high-resolution time-of-day measurements, or time stamps that are synchronized to UTC. For high-resolution interval measurements, use QueryPerformanceCounter or KeQueryPerformanceCounter. For more info about acquiring high-resolution time stamps, see Acquiring high-resolution time stamps.

Minimum supported client Windows 8 [desktop apps | UWP apps]

Minimum supported server Windows Server 2012 [desktop apps | UWP apps]

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation