Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Removes the gras_config.h inclusion, adds the portable.h inclusion for win32 portability.
[simgrid.git] / src / xbt / sysdep.c
index 6f6aea8..0c34750 100644 (file)
@@ -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
 }