]> git.tdb.fi Git - libs/core.git/blob - source/time/rawtime.cpp
Isolate platform-dependent RawTime conversion functions to a private header
[libs/core.git] / source / time / rawtime.cpp
1 #include "rawtime.h"
2 #include "rawtime_private.h"
3
4 namespace Msp {
5 namespace Time {
6
7 #ifndef WIN32
8 timeval rawtime_to_timeval(RawTime raw)
9 {
10         timeval tv;
11         tv.tv_sec = raw/1000000;
12         tv.tv_usec = raw%1000000;
13         return tv;
14 }
15
16 timespec rawtime_to_timespec(RawTime raw)
17 {
18         timespec ts;
19         ts.tv_sec = raw/1000000;
20         ts.tv_nsec = (raw%1000000)*1000;
21         return ts;
22 }
23 #endif
24
25 } // namespace Time
26 } // namespace Msp