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 "gras_private.h"
12 #include <sys/time.h> /* gettimeofday() */
14 double gras_os_time() {
17 gettimeofday(&tv, NULL);
19 return (double)(tv.tv_sec * 1000000 + tv.tv_usec);
22 void gras_os_sleep(unsigned long sec,unsigned long usec) {
24 if (usec/1000000) sleep(usec/1000000);
27 (void)usleep(usec % 1000000);
28 #endif /* ! HAVE_USLEEP */