utils/bench-packets.cc
changeset 53 ae406f4957d5
parent 16 99e833adbb46
child 54 f860e6f94787
--- a/utils/bench-packets.cc	Tue Sep 05 12:54:53 2006 +0200
+++ b/utils/bench-packets.cc	Tue Sep 05 13:13:39 2006 +0200
@@ -28,7 +28,7 @@
 using namespace ns3;
 
 static void 
-bench_ptr_a (uint32_t n)
+benchPtrA (uint32_t n)
 {
 	ChunkConstantData data = ChunkConstantData (2000, 1);
 	ChunkUdp udp;
@@ -50,7 +50,7 @@
 }
 
 static void 
-bench_ptr_b (uint32_t n)
+benchPtrB (uint32_t n)
 {
 	ChunkConstantData data = ChunkConstantData (2000, 1);
 	ChunkUdp udp;
@@ -65,7 +65,7 @@
 }
 
 static void
-ptr_c2 (Packet p)
+ptrC2 (Packet p)
 {
 	ChunkConstantData data = ChunkConstantData (2000, 1);
 	ChunkUdp udp;
@@ -77,16 +77,16 @@
 }
 
 static void 
-ptr_c1 (Packet p)
+ptrC1 (Packet p)
 {
 	ChunkIpv4 ipv4;
 	p.peek (&ipv4);
 	p.remove (&ipv4);
-	ptr_c2 (p);
+	ptrC2 (p);
 }
 
 static void
-bench_ptr_c (uint32_t n)
+benchPtrC (uint32_t n)
 {
 	ChunkConstantData data = ChunkConstantData (2000, 1);
 	ChunkUdp udp;
@@ -97,21 +97,21 @@
 		p.add (&data);
 		p.add (&udp);
 		p.add (&ipv4);
-		ptr_c1 (p);
+		ptrC1 (p);
 	}
 }
 
 
 static void
-run_bench (void (*bench) (uint32_t), uint32_t n, char const *name)
+runBench (void (*bench) (uint32_t), uint32_t n, char const *name)
 {
 	WallClockMs time;
 	time.start ();
 	(*bench) (n);
-	unsigned long long delta_ms = time.end ();
+	unsigned long long deltaMs = time.end ();
 	double ps = n;
 	ps *= 1000;
-	ps /= delta_ms;
+	ps /= deltaMs;
 	std::cout << name<<"=" << ps << " packets/s" << std::endl;
 }
 
@@ -120,16 +120,16 @@
 	uint32_t n = 0;
 	while (argc > 0) {
 		if (strncmp ("--n=", argv[0],strlen ("--n=")) == 0) {
-			char const *n_ascii = argv[0] + strlen ("--n=");
-			n = atoi (n_ascii);
+			char const *nAscii = argv[0] + strlen ("--n=");
+			n = atoi (nAscii);
 		}
 		argc--;
 		argv++;
 	}
 
-	run_bench (&bench_ptr_a, n, "a");
-	run_bench (&bench_ptr_b, n, "b");
-	run_bench (&bench_ptr_c, n, "c");
+	runBench (&benchPtrA, n, "a");
+	runBench (&benchPtrB, n, "b");
+	runBench (&benchPtrC, n, "c");
 
 	return 0;
 }