3 /* time - time related syscal wrappers */
5 /* Authors: Martin Quinson */
6 /* Copyright (C) 2003,2004 da GRAS posse. */
8 /* This program is free software; you can redistribute it and/or modify it
9 under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "xbt/sysdep.h"
12 #include "gras/virtu.h"
13 #include <sys/time.h> /* gettimeofday() */
15 double gras_os_time() {
18 gettimeofday(&tv, NULL);
20 return (double)(tv.tv_sec * 1000000 + tv.tv_usec);
23 void gras_os_sleep(unsigned long sec,unsigned long usec) {
25 if (usec/1000000) sleep(usec/1000000);
28 (void)usleep(usec % 1000000);
29 #endif /* ! HAVE_USLEEP */