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

Function readClockDataV2

fbclock/shmem_notlinux.go:223–236  ·  view source on GitHub ↗

readClockDataV2 deserializes a DataV2 from a section's 56-byte data buffer.

(buf []byte)

Source from the content-addressed store, hash-verified

221
222// readClockDataV2 deserializes a DataV2 from a section's 56-byte data buffer.
223func readClockDataV2(buf []byte) *DataV2 {
224 return &DataV2{
225 IngressTimeNS: int64(binary.LittleEndian.Uint64(buf[0:8])), //nolint:gosec
226 ErrorBoundNS: uint64(binary.LittleEndian.Uint32(buf[8:12])),
227 HoldoverMultiplierNS: Uint32AsFloat(binary.LittleEndian.Uint32(buf[12:16])),
228 SmearingStartS: binary.LittleEndian.Uint64(buf[16:24]),
229 UTCOffsetPreS: int16(binary.LittleEndian.Uint16(buf[24:26])), //nolint:gosec
230 UTCOffsetPostS: int16(binary.LittleEndian.Uint16(buf[26:28])), //nolint:gosec
231 ClockID: binary.LittleEndian.Uint32(buf[28:32]),
232 PHCTimeNS: int64(binary.LittleEndian.Uint64(buf[32:40])), //nolint:gosec
233 SysclockTimeNS: int64(binary.LittleEndian.Uint64(buf[40:48])), //nolint:gosec
234 CoefPPB: int64(binary.LittleEndian.Uint64(buf[48:56])), //nolint:gosec
235 }
236}
237
238// StoreFBClockDataV2 writes the primary anchor section. The two sections are
239// independent seqlock sections on separate cache lines, mirroring the C

Callers 2

ReadFBClockDataV2Function · 0.85
ReadFBClockDataRealtimeFunction · 0.85

Calls 1

Uint32AsFloatFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…