Files
FWS-Kitty/tools/utils/clock_with_raw.go
T
BlackAngelTV 7e7d249099 chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty,
vendored at upstream commit 91fb38a without its git history.
2026-11-04 11:20:47 +01:00

19 lines
308 B
Go

//go:build linux || darwin
package utils
import (
"time"
"golang.org/x/sys/unix"
)
func MonotonicRaw() (time.Time, error) {
ts := unix.Timespec{}
if err := unix.ClockGettime(unix.CLOCK_MONOTONIC_RAW, &ts); err != nil {
return time.Time{}, err
}
s, ns := ts.Unix()
return time.Unix(s, ns), nil
}