Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
moving timer functions so that we can use them for internals
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 14 Apr 2005 21:34:27 +0000 (21:34 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 14 Apr 2005 21:34:27 +0000 (21:34 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1215 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/sysdep.h
src/Makefile.am
src/gras/Virtu/rl_time.c
src/gras/Virtu/sg_chrono.c
src/xbt/sysdep.c

index 4bd3cea..b405a7a 100644 (file)
@@ -91,13 +91,6 @@ static inline void *xbt_realloc(void*p,int s){
 
 /** @} */  
 
 
 /** @} */  
 
-/** @brief get time in seconds 
-
-  * gives  the  number  of  seconds since the Epoch (00:00:00 UTC, January 1, 1970).
-  * Most users should use gras_os_time and should not use this function unless 
-    they really know what they are doing. */
-double xbt_os_time(void);
-
 END_DECL()
 
 #endif /* _XBT_SYSDEP_H */
 END_DECL()
 
 #endif /* _XBT_SYSDEP_H */
index 9defdbd..24f1e18 100644 (file)
@@ -41,6 +41,7 @@ EXTRA_DIST= \
        include/surf/surf.h \
        include/surf/surf_parse.h \
        \
        include/surf/surf.h \
        include/surf/surf_parse.h \
        \
+       include/xbt/xbt_portability.h \
        include/xbt/context.h \
        \
        msg/private.h \
        include/xbt/context.h \
        \
        msg/private.h \
index e9d07b2..b7e6292 100644 (file)
 
 #include "xbt/sysdep.h"
 #include "gras/virtu.h"
 
 #include "xbt/sysdep.h"
 #include "gras/virtu.h"
+#include "xbt/xbt_portability.h" /* private */
 
 XBT_LOG_EXTERNAL_CATEGORY(virtu);
 XBT_LOG_DEFAULT_CATEGORY(virtu);
 
 double gras_os_time() {
 
 XBT_LOG_EXTERNAL_CATEGORY(virtu);
 XBT_LOG_DEFAULT_CATEGORY(virtu);
 
 double gras_os_time() {
-#ifdef HAVE_GETTIMEOFDAY
-  struct timeval tv;
-
-  gettimeofday(&tv, NULL);
-
-  return (double)(tv.tv_sec + tv.tv_usec / 1000000.0);
-#else
-  /* Poor resolution */
-  return (double)(time(NULL)); 
-#endif /* HAVE_GETTIMEOFDAY? */ 
-       
+  return xbt_os_time();
 }
  
 void gras_os_sleep(double sec) {
 }
  
 void gras_os_sleep(double sec) {
index 6ac5269..9b16b28 100644 (file)
@@ -11,6 +11,7 @@
 #include "xbt/dict.h"
 #include "gras/chrono.h"
 #include "msg/msg.h"
 #include "xbt/dict.h"
 #include "gras/chrono.h"
 #include "msg/msg.h"
+#include "xbt/xbt_portability.h"
 #include "portable.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(chrono,gras,"Benchmarking used code");
 #include "portable.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(chrono,gras,"Benchmarking used code");
index 428d006..d4199ce 100644 (file)
@@ -10,6 +10,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/sysdep.h"
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/sysdep.h"
+#include "xbt/xbt_portability.h" /* private */
 #include "xbt/log.h"
 #include "xbt/error.h"
 #include "portable.h"
 #include "xbt/log.h"
 #include "xbt/error.h"
 #include "portable.h"