ae26653462b82006b3a0e33a308384175d1c122e
[ghc-hetmet.git] / rts / Timer.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 1995-2005
4  *
5  * Interval timer service for profiling and pre-emptive scheduling.
6  *
7  * ---------------------------------------------------------------------------*/
8
9 #ifndef TIMER_H
10 #define TIMER_H
11
12 # define TICK_MILLISECS   (1000/TICK_FREQUENCY)   /* ms per tick */
13
14 /* Context switch timing constants. Context switches happen after a
15  * whole number of ticks, the default being every tick.
16  */
17 #define CS_MIN_MILLISECS TICK_MILLISECS       /* milliseconds per slice */
18
19 typedef void (*TickProc)(int);
20
21 extern int startTimer(nat ms);
22 extern int stopTimer(void);
23
24 #endif /* TIMER_H */