[*] Update time util
This commit is contained in:
parent
557fd2b574
commit
52983989b5
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user