3 /* time - time related syscal wrappers */
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "math.h" /* floor */
14 #include "xbt/sysdep.h"
15 #include "gras/virtu.h"
16 #include "xbt/xbt_portability.h" /* private */
18 XBT_LOG_EXTERNAL_CATEGORY(virtu);
19 XBT_LOG_DEFAULT_CATEGORY(virtu);
21 double gras_os_time() {
25 void gras_os_sleep(double sec) {
26 DEBUG1("Do sleep %d sec", (int)sec);
30 DEBUG1("Do sleep %d usec", (int) ((sec - floor(sec)) * 1000000 ));
31 (void)usleep( (sec - floor(sec)) * 1000000);
33 if ( ((int) sec) == 0) {
34 WARN0("This platform does not implement usleep. Cannot sleep less than one second");
36 #endif /* ! HAVE_USLEEP */