Move getMonotonicUSec from base to the RTS.
[ghc.git] / rts / posix / Clock.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2012
4 *
5 * Posix monotonic clock
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef POSIX_CLOCK_H
10 #define POSIX_CLOCK_H
11
12 #ifdef HAVE_UNISTD_H
13 # include <unistd.h>
14 #endif
15
16 #ifdef HAVE_TIME_H
17 # include <time.h>
18 #endif
19
20 #ifdef HAVE_SYS_TIME_H
21 # include <sys/time.h>
22 #endif
23
24 #ifdef HAVE_CLOCK_GETTIME
25 # ifdef _POSIX_MONOTONIC_CLOCK
26 # define CLOCK_ID CLOCK_MONOTONIC
27 # else
28 # define CLOCK_ID CLOCK_REALTIME
29 # endif
30 #elif defined(darwin_HOST_OS)
31 # include <mach/mach.h>
32 # include <mach/mach_time.h>
33 #endif
34
35 #endif /* POSIX_CLOCK_H */