MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / FileTimeSecondsUntil

Function FileTimeSecondsUntil

source/util.cpp:298–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296
297
298__int64 FileTimeSecondsUntil(FILETIME *pftStart, FILETIME *pftEnd)
299// Returns the number of seconds from pftStart until pftEnd.
300{
301 if (!pftStart || !pftEnd) return 0;
302
303 // The calculation is done this way for compilers that don't support 64-bit math operations (not sure which):
304 // Note: This must be LARGE vs. ULARGE because we want the calculation to be signed for cases where
305 // pftStart is greater than pftEnd:
306 ULARGE_INTEGER uiStart, uiEnd;
307 uiStart.LowPart = pftStart->dwLowDateTime;
308 uiStart.HighPart = pftStart->dwHighDateTime;
309 uiEnd.LowPart = pftEnd->dwLowDateTime;
310 uiEnd.HighPart = pftEnd->dwHighDateTime;
311 // Must do at least the inner cast to avoid losing negative results:
312 return (__int64)((__int64)(uiEnd.QuadPart - uiStart.QuadPart) / 10000000); // Convert from tenths-of-microsecond.
313}
314
315
316

Callers 1

YYYYMMDDSecondsUntilFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected