blob: 2476454c3e64aa6c331d54b8d4fff6416ebd3d97 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team, 2012
*
* Posix monotonic clock
*
* ---------------------------------------------------------------------------*/
#pragma once
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <time.h>
#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
#endif
#if defined(HAVE_CLOCK_GETTIME)
# if defined(_POSIX_MONOTONIC_CLOCK)
# define CLOCK_ID CLOCK_MONOTONIC
# else
# define CLOCK_ID CLOCK_REALTIME
# endif
#elif defined(darwin_HOST_OS)
# include <mach/mach.h>
# include <mach/mach_time.h>
#endif
|