X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6760cb07d6b57be16928d95339d71e57c4e24f36..7f2b2cb65aff6ae1fe4ba58b721e48d2b9149d53:/src/xbt/xbt_virtu.c diff --git a/src/xbt/xbt_virtu.c b/src/xbt/xbt_virtu.c index 50ac9526bf..664d87b3eb 100644 --- a/src/xbt/xbt_virtu.c +++ b/src/xbt/xbt_virtu.c @@ -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(); +}