utils/bench-packets.cc
changeset 884 f3836277079e
parent 883 4d2da35c09b0
child 894 d6715af78f7e
--- a/utils/bench-packets.cc	Thu Jun 07 12:51:57 2007 +0200
+++ b/utils/bench-packets.cc	Thu Jun 07 13:16:15 2007 +0200
@@ -156,6 +156,22 @@
   }
 }
 
+static void
+benchPrint (uint32_t n)
+{
+  PacketPrinter printer;
+  BenchHeader<25> ipv4;
+  BenchHeader<8> udp;
+  Packet p (2000);
+  p.AddHeader (udp);
+  p.AddHeader (ipv4);
+
+  for (uint32_t i = 0; i < n; i++) 
+    {
+      p.Print (std::cerr, printer);
+    }  
+}
+
 
 static void
 runBench (void (*bench) (uint32_t), uint32_t n, char const *name)
@@ -188,6 +204,7 @@
   }
 
 
+  runBench (&benchPrint, n, "print");
   PacketMetadata::SetOptOne (false);
   runBench (&benchPtrA, n, "a");
   runBench (&benchPtrB, n, "b");