mirror of
https://github.com/romychs/Ocean-240.2-Emulator.git
synced 2026-04-21 11:03:21 +03:00
19 lines
282 B
Go
19 lines
282 B
Go
package nanotime
|
|
|
|
import (
|
|
"time"
|
|
_ "unsafe" // required to use //go:linkname
|
|
)
|
|
|
|
//go:noescape
|
|
//go:linkname nanotime runtime.nanotime
|
|
func nanotime() int64
|
|
|
|
func Now() uint64 {
|
|
return uint64(nanotime())
|
|
}
|
|
|
|
func Since(t uint64) time.Duration {
|
|
return time.Duration(Now() - t)
|
|
}
|