file header documentation regenerated with contributors names; no code modified in...
[cvc5.git] / src / lib / clock_gettime.h
1 /********************* */
2 /*! \file clock_gettime.h
3 ** \verbatim
4 ** Original author: mdeters
5 ** Major contributors: none
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 prototype.
8 ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys)
9 ** Courant Institute of Mathematical Sciences
10 ** New York University
11 ** See the file COPYING in the top-level source directory for licensing
12 ** information.\endverbatim
13 **
14 ** \brief Replacement for clock_gettime() for systems without it (like Mac OS X)
15 **
16 ** Replacement for clock_gettime() for systems without it (like Mac OS X).
17 **/
18
19 #ifndef __CVC4__LIB__CLOCK_GETTIME_H
20 #define __CVC4__LIB__CLOCK_GETTIME_H
21
22 #include "lib/replacements.h"
23
24 #ifdef HAVE_CLOCK_GETTIME
25
26 /* it should be available from <time.h> */
27 #include <time.h>
28
29 #else /* HAVE_CLOCK_GETTIME */
30
31 /* otherwise, we have to define it */
32
33 /* get timespec from <time.h> */
34 #include <time.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif /* __cplusplus */
39
40 typedef enum {
41 CLOCK_REALTIME,
42 CLOCK_MONOTONIC,
43 CLOCK_REALTIME_HR,
44 CLOCK_MONOTONIC_HR
45 } clockid_t;
46
47 long clock_gettime(clockid_t which_clock, struct timespec *tp);
48
49 #ifdef __cplusplus
50 }/* extern "C" */
51 #endif /* __cplusplus */
52
53 #endif /* HAVE_CLOCK_GETTIME */
54 #endif /*__CVC4__LIB__CLOCK_GETTIME_H */
55