Revision: 42015
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42015&view=rev
Author:   brlcad
Date:     2011-01-07 16:12:53 +0000 (Fri, 07 Jan 2011)

Log Message:
-----------
strict cleanup (devs should always --enable-warnings).  remove stdint.h, quell 
param/var warnings, add a counter.

Modified Paths:
--------------
    brlcad/trunk/src/libbu/timetester.c

Modified: brlcad/trunk/src/libbu/timetester.c
===================================================================
--- brlcad/trunk/src/libbu/timetester.c 2011-01-07 15:35:25 UTC (rev 42014)
+++ brlcad/trunk/src/libbu/timetester.c 2011-01-07 16:12:53 UTC (rev 42015)
@@ -23,7 +23,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdint.h>
 #include <inttypes.h>
 
 #include "bu.h"
@@ -31,19 +30,28 @@
 int
 main(int argc, char **argv)
 {
-       int64_t time1, time2;
-       int i = 0;
-       time1 = bu_gettime();
-       while (i < 1.0e6) {
-               time2 = bu_gettime();
-               i = time2 - time1;
-       }
-       printf("Time delta: %i\n", i);
-       printf("time1: %" PRIi64 "\n", time1);
-       printf("time2: %" PRIi64 "\n", time2);
-       exit(0);
+    int64_t time1, time2;
+    int i = 0;
+    unsigned long counter = 1;
+
+    if (argc > 1)
+       bu_exit(1, "ERROR: Unexpected parameter [%s]\n", argv[0]);
+
+    time1 = bu_gettime();
+    while (i < 1.0e6) {
+       counter++;
+       time2 = bu_gettime();
+       i = time2 - time1;
+    }
+    bu_log("Called bu_gettime() %lu times\n", counter);
+    bu_log("Time delta: %d\n", i);
+    bu_log("time1: %lu\n", (unsigned long)time1);
+    bu_log("time2: %lu\n", (unsigned long)time2);
+
+    return 0;
 }
 
+
 /** @} */
 /*
  * Local Variables:


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to