diff options
author | Paolo Capriotti <p.capriotti@gmail.com> | 2012-03-20 11:57:28 +0000 |
---|---|---|
committer | Paolo Capriotti <p.capriotti@gmail.com> | 2012-04-16 15:18:19 +0100 |
commit | 5ba7db93fb634ff8094f42780a14972322446a94 (patch) | |
tree | 7f460341d5e7aa16f8f6e361c5d2db74bd6c530b /rts/posix/Clock.h | |
parent | 3377abeb6bd4623c5806936d0ee569d123c1aa59 (diff) | |
download | haskell-5ba7db93fb634ff8094f42780a14972322446a94.tar.gz |
Use monotonic clock in Select.c (#5865)
Diffstat (limited to 'rts/posix/Clock.h')
-rw-r--r-- | rts/posix/Clock.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/rts/posix/Clock.h b/rts/posix/Clock.h new file mode 100644 index 0000000000..5062023fb6 --- /dev/null +++ b/rts/posix/Clock.h @@ -0,0 +1,32 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team, 2012 + * + * Posix monotonic clock + * + * ---------------------------------------------------------------------------*/ + +#ifndef POSIX_CLOCK_H +#define POSIX_CLOCK_H + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#ifdef HAVE_TIME_H +# include <time.h> +#endif + +#ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +#endif + +#ifdef HAVE_CLOCK_GETTIME +# ifdef _POSIX_MONOTONIC_CLOCK +# define CLOCK_ID CLOCK_MONOTONIC +# else +# define CLOCK_ID CLOCK_REALTIME +# endif +#endif + +#endif /* POSIX_CLOCK_H */ |