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

Function TestSysoffEstimateBasic

phc/offset_test.go:27–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestSysoffEstimateBasic(t *testing.T) {
28 ts1 := time.Unix(0, 1667818190552297411)
29 rt := time.Unix(0, 1667818153552297462)
30 ts2 := time.Unix(0, 1667818190552297522)
31 got := SysoffEstimateBasic(ts1, rt, ts2)
32 want := SysoffResult{
33 SysTime: time.Unix(0, 1667818190552297466),
34 PHCTime: rt,
35 Delay: ts2.Sub(ts1),
36 Offset: time.Duration(37000000005),
37 }
38 require.Equal(t, want, got)
39}
40
41func TestSysoffBestSample(t *testing.T) {
42 extended := &PTPSysOffsetExtended{

Callers

nothing calls this directly

Calls 4

SysoffEstimateBasicFunction · 0.85
UnixMethod · 0.80
SubMethod · 0.45
DurationMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…