Add rts time util getUnixEpochTime
[ghc.git] / rts / GetTime.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team 2005
4 *
5 * Machine-independent interface to time measurement
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef GETTIME_H
10 #define GETTIME_H
11
12 #include "BeginPrivate.h"
13
14 // We'll use a fixed resolution of usec for now. The machine
15 // dependent implementation may have a different resolution, but we'll
16 // normalise to this for the machine independent interface.
17 #define TICKS_PER_SECOND 1000000
18 typedef StgInt64 Ticks;
19
20 Ticks getProcessCPUTime (void);
21 Ticks getThreadCPUTime (void);
22 Ticks getProcessElapsedTime (void);
23 void getProcessTimes (Ticks *user, Ticks *elapsed);
24
25 /* Get the current date and time.
26 Uses seconds since the Unix epoch, plus nanoseconds
27 */
28 void getUnixEpochTime (StgWord64 *sec, StgWord32 *nsec);
29
30 // Not strictly timing, but related
31 nat getPageFaults (void);
32
33 #include "EndPrivate.h"
34
35 #endif /* GETTIME_H */