mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
time: implement timespec_to_timeval()
This commit is contained in:
@@ -57,4 +57,12 @@ static inline bool timespec_bigger(timespec_t t1, timespec_t t2) {
|
|||||||
return t1.s > t2.s || (t1.s == t2.s && t1.ns > t2.ns);
|
return t1.s > t2.s || (t1.s == t2.s && t1.ns > t2.ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline timeval_t timespec_to_timeval(timespec_t ts) {
|
||||||
|
timeval_t tv = {
|
||||||
|
ts.s,
|
||||||
|
ts.ns / 1000
|
||||||
|
};
|
||||||
|
return tv;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user