X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=test_looplen.c;h=e07409a64ca5ba61542ff8e6328894819fdd4765;hp=86d03863430b844a1a7c1998c0c10b9967bf1b54;hb=ed1289f1b3865b04eb268c26d310d08e19b4760b;hpb=fd6a23f245ce6fc26b45baf1db27c8d3b359719c diff --git a/test_looplen.c b/test_looplen.c index 86d0386..e07409a 100644 --- a/test_looplen.c +++ b/test_looplen.c @@ -71,6 +71,7 @@ int main(int argc, char **argv) unsigned long i; cycles_t time1, time2; cycles_t time_tot = 0; + double cpl; for (i = 0; i < TESTS; i++) { time1 = get_cycles(); @@ -78,10 +79,11 @@ int main(int argc, char **argv) time2 = get_cycles(); time_tot += time2 - time1; } - time_tot /= TESTS; - time_tot /= LOOPS; + cpl = ((double)time_tot) / (double)TESTS / (double)LOOPS; - printf("CALIBRATION : %llu cycles per loop\n", time_tot); + printf("CALIBRATION : %g cycles per loop\n", cpl); + printf("time_tot = %llu, LOOPS = %d, TESTS = %d\n", + time_tot, LOOPS, TESTS); return 0; }