Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't use xbt_os_time() when not needed
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 13 Nov 2014 12:10:59 +0000 (13:10 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 13 Nov 2014 12:11:06 +0000 (13:11 +0100)
src/simix/smx_environment.c

index 7317c36..8f8e7d4 100644 (file)
@@ -34,10 +34,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix,
 void SIMIX_create_environment(const char *file)
 {
   double start, end;
-
-  start = xbt_os_time();
+  if(XBT_LOG_ISENABLED(simix_environment, xbt_log_priority_debug))
+    start = xbt_os_time();
   parse_platform_file(file);
-  end = xbt_os_time();
+  if(XBT_LOG_ISENABLED(simix_environment, xbt_log_priority_debug))
+    end = xbt_os_time();
   XBT_DEBUG("PARSE TIME: %g", (end - start));
 
 }