[project @ 2003-09-17 21:20:16 by sof]
[ghc-hetmet.git] / ghc / rts / Timer.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 1995-2003
4  *
5  * Interval timer service for profiling and pre-emptive scheduling.
6  *
7  * ---------------------------------------------------------------------------*/
8 #ifndef __TIMER_H__
9 #define __TIMER_H__
10
11 # define TICK_FREQUENCY   50                      /* ticks per second */
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 #endif /* __TIMER_H__ */