Exemplo n.º 1
0
func getRawMonoTime() (int64, int64) {
	var timeSpec syscall.Timespec

	syscall.Syscall(syscall.SYS_CLOCK_GETTIME, CLOCK_MONOTONIC_RAW, uintptr(unsafe.Pointer(&timeSpec)), 0)

	sec, nsec := timeSpec.Unix()

	return sec, nsec
}
Exemplo n.º 2
0
func timeFromTimespec(ts syscall.Timespec) time.Time {
	sec, nsec := ts.Unix()
	return time.Unix(sec, nsec)
}
Exemplo n.º 3
0
func toTime(src syscall.Timespec) time.Time {
	sec, nsec := src.Unix()
	return time.Unix(sec, nsec)
}