mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-07-03 11:12:30 +08:00
...
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user