From 4f804e9ae63866852f7e7524ded686f9747cbeb7 Mon Sep 17 00:00:00 2001 From: zimmerma Date: Tue, 5 Jan 2016 07:58:46 +0000 Subject: mpfrbench: use clock() when getrusage() is not available git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9784 280ebfd0-de03-0410-8827-d642c229c3f4 --- tools/bench/mpfrbench.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/bench') 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 #include +#else +#include #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 } -- cgit v1.2.1