This commit is contained in:
Kovid Goyal 2024-04-09 08:39:42 +05:30
parent a444b5eccb
commit 3d98b33076
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -4,15 +4,8 @@ package utils
import (
"time"
"golang.org/x/sys/unix"
)
func MonotonicRaw() (time.Time, error) {
ts := unix.Timespec{}
if err := unix.ClockGettime(unix.CLOCK_MONOTONIC, &ts); err != nil {
return time.Time{}, err
}
s, ns := ts.Unix()
return time.Unix(s, ns), nil
return time.Now(), nil
}