2 #include "rawtime_private.h"
7 /// Returns the unixtime epoch as filetime
8 Msp::Time::RawTime get_epoch()
20 SystemTimeToFileTime(&st, &ft);
21 return (ft.dwLowDateTime+(static_cast<Msp::Time::RawTime>(ft.dwHighDateTime)<<32))/10;
32 RawTime filetime_to_rawtime(const FILETIME &ft)
34 static RawTime epoch = get_epoch();
36 return (ft.dwLowDateTime+(static_cast<RawTime>(ft.dwHighDateTime)<<32))/10-epoch;
39 timeval rawtime_to_timeval(RawTime raw)
42 tv.tv_sec = raw/1000000;
43 tv.tv_usec = raw%1000000;
47 timespec rawtime_to_timespec(RawTime raw)
50 ts.tv_sec = raw/1000000;
51 ts.tv_nsec = (raw%1000000)*1000;
55 RawTime timeval_to_rawtime(const timeval &tv)
57 return tv.tv_sec*1000000LL+tv.tv_usec;