mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
time: introduce a new timespec_ns helper
This just returns the total number of elapsed nanoseconds given a timespec struct.
This commit is contained in:
@@ -35,4 +35,8 @@ static inline time_t timespec_diffus(timespec_t a, timespec_t b) {
|
||||
return nsecdiff / 1000 + secdiff * 1000000;
|
||||
}
|
||||
|
||||
static inline time_t timespec_ns(timespec_t a) {
|
||||
return a.ns + a.s * 1000000000;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user