From 76df048700277bb46f84118c334e6566b388167e Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Fri, 29 May 2015 16:34:46 -0700 Subject: [PATCH] Dhrystone: print dmips with better precision. --- share/examples/dhrystone/dhry_1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/examples/dhrystone/dhry_1.c b/share/examples/dhrystone/dhry_1.c index bb50a07..2486d71 100644 --- a/share/examples/dhrystone/dhry_1.c +++ b/share/examples/dhrystone/dhry_1.c @@ -218,14 +218,14 @@ again: /* Dhrystones per 10^-5 sec. */ Dhrystones_per_Millisecond = Number_Of_Runs / (Microseconds / 1000); - Dmips = Dhrystones_per_Millisecond * 1000 / DHRYSTONES_PER_DMIPS; + Dmips = Dhrystones_per_Millisecond * 10000 / DHRYSTONES_PER_DMIPS; printf ("Nanoseconds for one run through Dhrystone: %lu \n", Microseconds / (Number_Of_Runs / 1000)); printf (" Million Dhrystones per Second: %lu.%03lu \n", Dhrystones_per_Millisecond / 1000, Dhrystones_per_Millisecond % 1000); - printf (" DMIPS: %lu \n", - Dmips); + printf (" DMIPS: %lu.%lu \n", + Dmips / 10, Dmips % 10); printf ("\n"); return 0;