X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/832fed2e817aad1deb04971a551b7a5204981d87..6fe4fa359ecb9b9941fe5800f147c247d228e3a0:/src/xbt/sysdep.c diff --git a/src/xbt/sysdep.c b/src/xbt/sysdep.c index 6f6aea8b8a..ebb24551b5 100644 --- a/src/xbt/sysdep.c +++ b/src/xbt/sysdep.c @@ -12,10 +12,17 @@ #include "xbt/sysdep.h" #include "xbt/xbt_portability.h" /* private */ #include "xbt/log.h" -#include "xbt/error.h" #include "portable.h" +/** @brief like free + @hideinitializer */ +XBT_PUBLIC(void) xbt_free_f(void* p) +{ + free(p); +} + + /* TSC (tick-level) timers are said to be unreliable on SMP hosts and thus disabled in SDL source code */ @@ -38,7 +45,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 +77,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 }