Posix time: microsec_clock:
Get the UTC time using the second timer clock. On Unix systems, this is implemented using GetTimeOfDay. On most platforms, Win32 is implemented using ftime. Thanks to these APIs, Win32 systems often fail to achieve microsecond resolution. If a higher resolution is critical to your application, check your platform to see the resolution achieved.
ftime just does not provide microsecond resolution. The argument may contain the word microsecond , but the implementation does not provide any precision in this range. This granularity is in ms mode.
You will get something other than ZERO when you need more time, say, more than a minimum of 20 ms.
Edit: Note. Ultimately, the microsec_clock implementation for Windows should use the GetSystemTimePreciseAsFileTime function when (min. Windows 8 desktop, Windows Server 2012 desktop) to achieve the resolution in microseconds.
source share