MCPcopy Create free account
hub / github.com/catboost/catboost / FileTimeToTimeval

Function FileTimeToTimeval

util/datetime/systime.cpp:20–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18} // namespace
19
20void FileTimeToTimeval(const FILETIME* ft, timeval* tv) {
21 Y_ASSERT(ft);
22 Y_ASSERT(tv);
23 TFTUnion ntTime;
24 ntTime.FTStruct = *ft;
25 ntTime.FTScalar -= NUMBER_OF_100_NANO_BETWEEN_1601_1970;
26 tv->tv_sec =
27 static_cast<long>(ntTime.FTScalar / NUMBER_OF_100_NANO_IN_SECOND);
28 tv->tv_usec = static_cast<long>(
29 (ntTime.FTScalar % NUMBER_OF_100_NANO_IN_SECOND) / LL(10));
30}
31
32void FileTimeToTimespec(const FILETIME& ft, struct timespec* ts) {
33 Y_ASSERT(ts);

Callers 2

gettimeofdayFunction · 0.85
ProcessUptimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected