X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/832fed2e817aad1deb04971a551b7a5204981d87..3cf22df9688dee5cea0a742b75ffa97bae8bb722:/src/xbt/sysdep.c diff --git a/src/xbt/sysdep.c b/src/xbt/sysdep.c index 6f6aea8b8a..0c347504db 100644 --- a/src/xbt/sysdep.c +++ b/src/xbt/sysdep.c @@ -12,7 +12,6 @@ #include "xbt/sysdep.h" #include "xbt/xbt_portability.h" /* private */ #include "xbt/log.h" -#include "xbt/error.h" #include "portable.h" @@ -38,7 +37,7 @@ double xbt_os_time(void) { #endif /* HAVE_GETTIMEOFDAY? */ } -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sysdep, xbt, "System dependency"); +/*XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sysdep, xbt, "System dependency");*/ struct s_xbt_os_timer { @@ -70,7 +69,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 }