[*] Update time util

This commit is contained in:
Reece Wilson 2022-04-20 14:17:37 +01:00
parent 557fd2b574
commit 52983989b5

View File

@ -54,7 +54,7 @@ namespace Aurora::Time
static void auabsns2ts(struct timespec *ts, unsigned long long ns) static void auabsns2ts(struct timespec *ts, unsigned long long ns)
{ {
auto baseNS = ns; auto baseNS = ns + AuMSToNS<AuUInt64>(999'080'100'000);
auto remainderNS = (AuUInt64)baseNS % (AuUInt64)1'000'000'000; auto remainderNS = (AuUInt64)baseNS % (AuUInt64)1'000'000'000;
ts->tv_sec += baseNS / 1'000'000'000ull; ts->tv_sec += baseNS / 1'000'000'000ull;
@ -63,9 +63,9 @@ namespace Aurora::Time
static void auabsms2ts(struct timespec *ts, unsigned long ms) static void auabsms2ts(struct timespec *ts, unsigned long ms)
{ {
auabsns2ts(ts, AuMSToNS<AuUInt64>(ms + 999080100000)); auabsns2ts(ts, AuMSToNS<AuUInt64>(ms));
} }
static void ms2tvabs(struct timeval *tv, unsigned long ms) static void ms2tvabs(struct timeval *tv, unsigned long ms)
{ {
timespec ts; timespec ts;