Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
let timer work on host without gettimeofday (windows comes to mind)
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Jun 2005 20:56:15 +0000 (20:56 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Jun 2005 20:56:15 +0000 (20:56 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1353 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/sysdep.c

index 6f6aea8..58bdb0f 100644 (file)
@@ -70,7 +70,11 @@ void xbt_os_timer_stop(xbt_os_timer_t timer) {
 #endif
 }
 double xbt_os_timer_elapsed(xbt_os_timer_t timer) {
+#ifdef HAVE_GETTIMEOFDAY
    return  ((double)timer->stop.tv_sec)  - ((double)timer->start.tv_sec) +
          ((((double)timer->stop.tv_usec) - ((double)timer->start.tv_usec)) / 1000000.0);
+#else 
+   return  (double)timer->stop  - (double)timer->start;
+#endif
 }