Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace usleep for nanosleep
[simgrid.git] / src / xbt / xbt_sg_time.c
1 /* time - time related syscal wrappers                                      */
2
3 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #include "gras/Virtu/virtu_sg.h"
10 #include "simgrid/simix.h"
11
12 /*
13  * Time elapsed since the begining of the simulation.
14  */
15 double xbt_time()
16 {
17   /* FIXME: check if we should use the request mechanism or not */
18   return SIMIX_get_clock();
19 }
20
21 /*
22  * Freeze the process for the specified amount of time
23  */
24 void xbt_sleep(double sec)
25 {
26   simcall_process_sleep(sec);
27 }
28
29 const char *xbt_procname(void)
30 {
31   return SIMIX_process_self_get_name();
32 }
33