diff options
Diffstat (limited to 'tools/bench')
-rw-r--r-- | tools/bench/mpfrbench.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/bench/mpfrbench.c b/tools/bench/mpfrbench.c index e1d07ca34..29e9bb58a 100644 --- a/tools/bench/mpfrbench.c +++ b/tools/bench/mpfrbench.c @@ -25,6 +25,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef HAVE_GETRUSAGE #include <sys/time.h> #include <sys/resource.h> +#else +#include <time.h> #endif #include "mpfr.h" #include "benchtime.h" @@ -115,9 +117,7 @@ get_cputime (void) return ru.ru_utime.tv_sec * 1000000 + ru.ru_utime.tv_usec + ru.ru_stime.tv_sec * 1000000 + ru.ru_stime.tv_usec; #else - printf ("\nError, the function getrusage is not available\n"); - exit (1); - return 0; + return (unsigned long) ((double) clock () / ((double) CLOCKS_PER_SEC / 1e6)); #endif } |