MCPcopy Create free account
hub / github.com/facebook/time / byteToTime

Function byteToTime

timestamp/timestamp_linux.go:90–96  ·  view source on GitHub ↗

byteToTime converts bytes into a timestamp

(data []byte)

Source from the content-addressed store, hash-verified

88 // __kernel_timespec from linux/time_types.h
89 // can't use unix.Timespec which is old timespec that uses 32bit ints on 386 platform.
90 sec := *(*int64)(unsafe.Pointer(&data[0]))
91 nsec := *(*int64)(unsafe.Pointer(&data[8]))
92 return time.Unix(sec, nsec), nil
93}
94
95func ioctlHWTimestampCaps(fd int, ifname string) (int32, error) {
96 var rxFilter int32
97
98 hw, err := unix.IoctlGetEthtoolTsInfo(fd, ifname)
99 if err != nil {

Callers 3

scmDataToTimeFunction · 0.70
Test_byteToTimeFunction · 0.70
Test_byteToTimeFunction · 0.70

Calls 1

UnixMethod · 0.80

Tested by 2

Test_byteToTimeFunction · 0.56
Test_byteToTimeFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…