Difference between GetLocalTime and GetSystemTime?

I use GetLocalTime in my code to check how long a particular function takes to process.

For this purpose, which is the best choice of GetLocalTime or GetSystemTime ?

They are the same? Which one should I use if I measure code performance.
+4
source share
1 answer

Two functions have the same resolution; the difference is that GetLocalTime returns the system time configured for your current time zone (i.e. your local time, not UTC).

To measure code performance using any of these functions is likely to be less than ideal. Instead, I would look at using performance counter functions, as they offer much less overhead and the highest resolution possible.

See the MS Knowledge Base article for more information: How to use a QueryPerformanceCounter for time code (the sample code is in VB, but this concept applies to C ++, and also - basically, use a QueryPerformanceCounter to get before and after ticks and QueryPerformanceFrequency to convert ticks to seconds).

+3
source

Source: https://habr.com/ru/post/1489393/


All Articles