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

Function clockDataV2ToC

fbclock/shmem.go:227–240  ·  view source on GitHub ↗

clockDataV2ToC builds the C clockdata_v2 struct from a DataV2.

(d DataV2)

Source from the content-addressed store, hash-verified

225
226// clockDataV2ToC builds the C clockdata_v2 struct from a DataV2.
227func clockDataV2ToC(d DataV2) *C.fbclock_clockdata_v2 {
228 return &C.fbclock_clockdata_v2{
229 ingress_time_ns: C.int64_t(d.IngressTimeNS),
230 error_bound_ns: C.uint32_t(Uint64ToUint32(d.ErrorBoundNS)),
231 holdover_multiplier_ns: C.uint32_t(FloatAsUint32(d.HoldoverMultiplierNS)),
232 clock_smearing_start_s: C.uint64_t(d.SmearingStartS),
233 utc_offset_pre_s: C.int16_t(d.UTCOffsetPreS),
234 utc_offset_post_s: C.int16_t(d.UTCOffsetPostS),
235 clockId: C.uint32_t(d.ClockID),
236 phc_time_ns: C.int64_t(d.PHCTimeNS),
237 sysclock_time_ns: C.int64_t(d.SysclockTimeNS),
238 coef_ppb: C.int64_t(d.CoefPPB),
239 }
240}
241
242// clockDataV2FromC builds a DataV2 from the C clockdata_v2 struct.
243func clockDataV2FromC(c *C.fbclock_clockdata_v2) *DataV2 {

Callers 2

StoreFBClockDataV2Function · 0.85
StoreFBClockDataRealtimeFunction · 0.85

Calls 2

Uint64ToUint32Function · 0.85
FloatAsUint32Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…