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