From: mquinson Date: Fri, 10 Dec 2004 15:30:30 +0000 (+0000) Subject: Fix the semantic (gras_os_time returns seconds); Fix output (I didn't understood... X-Git-Tag: v3.3~4733 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fddb39378296b21969d5a7f90492852c0c696eec?hp=dd3ac41f3f76a6267b843ccfb4765959da283688 Fix the semantic (gras_os_time returns seconds); Fix output (I didn't understood the subtility of the cast to double by adding 0.0) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@617 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/testsuite/xbt/heap_bench.c b/testsuite/xbt/heap_bench.c index d65ede62ad..7db507f70e 100644 --- a/testsuite/xbt/heap_bench.c +++ b/testsuite/xbt/heap_bench.c @@ -66,20 +66,20 @@ void test_heap_mean_operation(int size) double date = 0; int i, j; - date = gras_os_time(); + date = gras_os_time() * 1000000; for (i = 0; i < size; i++) xbt_heap_push(heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0))); - date = gras_os_time() - date; - printf("Creation time %d size heap : %f\n", size, 0.0 + date); + date = gras_os_time() * 1000000 - date; + printf("Creation time %d size heap : %g\n", size, date); - date = gras_os_time(); + date = gras_os_time() * 1000000; for (j = 0; j < MAX_TEST; j++) { val = xbt_heap_maxkey(heap); xbt_heap_pop(heap); xbt_heap_push(heap, NULL, 3.0 * val); } - date = gras_os_time() - date; - printf("Mean access time for a %d size heap : %f\n", size, + date = gras_os_time() * 1000000 - date; + printf("Mean access time for a %d size heap : %g\n", size, date * 1.0 / (MAX_TEST + 0.0)); xbt_heap_free(heap);