Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
File is unused since commit 678328fb7b84cbcebfff2e5df242b59fb0a0b9ff.
[simgrid.git] / src / xbt / xbt_virtu.c
index 50ac952..664d87b 100644 (file)
@@ -9,6 +9,7 @@
 #include "xbt/misc.h"
 #include "xbt/virtu.h"
 #include "xbt/function_types.h"
+#include "simgrid/simix.h"
 
 static int xbt_fake_pid(void)
 {
@@ -16,3 +17,25 @@ static int xbt_fake_pid(void)
 }
 
 int_f_void_t xbt_getpid = xbt_fake_pid;
+
+/*
+ * Time elapsed since the beginning of the simulation.
+ */
+double xbt_time()
+{
+  /* FIXME: check if we should use the request mechanism or not */
+  return SIMIX_get_clock();
+}
+
+/*
+ * Freeze the process for the specified amount of time
+ */
+void xbt_sleep(double sec)
+{
+  simcall_process_sleep(sec);
+}
+
+const char *xbt_procname(void)
+{
+  return SIMIX_process_self_get_name();
+}