[Asterisk-cvs] zaptel zttest.c,1.1,1.2

markster at lists.digium.com markster at lists.digium.com
Mon Mar 28 23:29:23 CST 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv7162

Modified Files:
	zttest.c 
Log Message:
Improve zttest (bug #3705)


Index: zttest.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zttest.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- zttest.c	2 May 2004 00:40:47 -0000	1.1
+++ zttest.c	29 Mar 2005 05:23:08 -0000	1.2
@@ -13,11 +13,12 @@
 static int pass = 0;
 static float best = 0.0;
 static float worst = 100.0;
+static float total = 0.0;
 
 void hup_handler(int sig)
 {
 	printf("\n--- Results after %d passes ---\n", pass);
-	printf("Best: %f -- Worst: %f\n", best, worst);
+	printf("Best: %f -- Worst: %f -- Average: %f\n", best, worst, pass ? total/pass : 100.00);
 	exit(0);
 }
 
@@ -71,6 +72,7 @@
 			if (score < worst)
 				worst = score;
 			printf("%f%% ", score);
+			total += score;
 			fflush(stdout);
 			count = 0;
 			pass++;




More information about the svn-commits mailing list