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

Function FileTimeToTimespec

util/datetime/systime.cpp:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void FileTimeToTimespec(const FILETIME& ft, struct timespec* ts) {
33 Y_ASSERT(ts);
34 TFTUnion ntTime;
35 ntTime.FTStruct = ft;
36 ntTime.FTScalar -= NUMBER_OF_100_NANO_BETWEEN_1601_1970;
37 ts->tv_sec =
38 static_cast<time_t>(ntTime.FTScalar / NUMBER_OF_100_NANO_IN_SECOND);
39 ts->tv_nsec = static_cast<long>(
40 (ntTime.FTScalar % NUMBER_OF_100_NANO_IN_SECOND) * LL(100));
41}
42
43int gettimeofday(timeval* tp, void*) {
44 FILETIME ft;

Callers 1

MakeStatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected