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

Function BenchmarkWriteSignaling

ptp/protocol/unicast_test.go:340–380  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

338}
339
340func BenchmarkWriteSignaling(b *testing.B) {
341 p := &Signaling{
342 Header: Header{
343 SdoIDAndMsgType: NewSdoIDAndMsgType(MessageSignaling, 0),
344 Version: 2,
345 MessageLength: 56,
346 DomainNumber: 0,
347 MinorSdoID: 0,
348 FlagField: FlagUnicast | FlagTwoStep,
349 CorrectionField: 0,
350 MessageTypeSpecific: 0,
351 SourcePortIdentity: PortIdentity{
352 PortNumber: 1,
353 ClockIdentity: 16437344792485782624,
354 },
355 SequenceID: 7620,
356 ControlField: 5,
357 LogMessageInterval: 0x7f,
358 },
359 TargetPortIdentity: PortIdentity{
360 PortNumber: 1,
361 ClockIdentity: 5212879185253000328,
362 },
363 TLVs: []TLV{
364 &GrantUnicastTransmissionTLV{
365 TLVHead: TLVHead{
366 TLVType: TLVGrantUnicastTransmission,
367 LengthField: 8,
368 },
369 MsgTypeAndReserved: NewUnicastMsgTypeAndFlags(MessageAnnounce, 0),
370 LogInterMessagePeriod: 1,
371 DurationField: 60,
372 Renewal: 1,
373 },
374 },
375 }
376 buf := make([]byte, 64)
377 for n := 0; n < b.N; n++ {
378 _, _ = BytesTo(p, buf)
379 }
380}
381
382func BenchmarkReadSignaling(b *testing.B) {
383 raw := []uint8{0x0c, 0x02, 0x00, 0x38, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,

Callers

nothing calls this directly

Calls 3

NewSdoIDAndMsgTypeFunction · 0.85
BytesToFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…