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

Function BenchmarkWriteFollowup

ptp/protocol/protocol_test.go:481–508  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

479}
480
481func BenchmarkWriteFollowup(b *testing.B) {
482 p := &FollowUp{
483 Header: Header{
484 SdoIDAndMsgType: NewSdoIDAndMsgType(MessageFollowUp, 0),
485 Version: MajorVersion,
486 MessageLength: uint16(binary.Size(FollowUp{})),
487 DomainNumber: 0,
488 FlagField: FlagUnicast,
489 SequenceID: 0,
490 SourcePortIdentity: PortIdentity{
491 PortNumber: 1,
492 ClockIdentity: 36138748164966842,
493 },
494 LogMessageInterval: 0,
495 ControlField: 2,
496 },
497 FollowUpBody: FollowUpBody{
498 PreciseOriginTimestamp: Timestamp{
499 Seconds: [6]byte{0x0, 0x00, 0x45, 0xb1, 0x11, 0x5e},
500 Nanoseconds: 73257582,
501 },
502 },
503 }
504 buf := make([]byte, 64)
505 for n := 0; n < b.N; n++ {
506 _, _ = BytesTo(p, buf)
507 }
508}
509
510func TestReqPDelayMarshalUnmarshal(t *testing.T) {
511 clockID := ClockIdentity(0x123456789abcdef0)

Callers

nothing calls this directly

Calls 3

NewSdoIDAndMsgTypeFunction · 0.85
BytesToFunction · 0.85
SizeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…