aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-10-05 14:45:37 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-10-05 14:45:37 -0400
commitd8130c61443893e490d19da25ea5f32814c5367b (patch)
treee35e23039bf8e811280f435d4fdfec97bef4322c
parentb5e16fb14006c3813bd785c4c289dcc0f7e37b59 (diff)
nicer output for cycle calibration
-rw-r--r--bin/cycles.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/cycles.c b/bin/cycles.c
index 4e5a078..a6b9308 100644
--- a/bin/cycles.c
+++ b/bin/cycles.c
@@ -8,7 +8,7 @@ int main(int argc, char** argv)
8{ 8{
9 cycles_t t1, t2; 9 cycles_t t1, t2;
10 int secs = 1; 10 int secs = 1;
11 11
12 if (argc > 1) { 12 if (argc > 1) {
13 secs = atoi(argv[1]); 13 secs = atoi(argv[1]);
14 if (secs <= 0) 14 if (secs <= 0)
@@ -19,7 +19,10 @@ int main(int argc, char** argv)
19 sleep(secs); 19 sleep(secs);
20 t2 = get_cycles(); 20 t2 = get_cycles();
21 t2 -= t1; 21 t2 -= t1;
22 printf("%.2f/sec\n", t2 / (double) secs); 22 printf("%.2f/sec %.2f/msec %.2f/usec\n",
23 t2 / (double) secs,
24 t2 / (secs * 1000.0),
25 t2 / (secs * 1000000.0));
23 } 26 }
24 return 0; 27 return 0;
25} 28}