[project @ 2001-08-14 13:40:07 by sewardj]
[ghc-hetmet.git] / ghc / rts / Proftimer.c
1 /* -----------------------------------------------------------------------------
2  * $Id: Proftimer.c,v 1.7 2001/08/14 13:40:09 sewardj Exp $
3  *
4  * (c) The GHC Team, 1998-1999
5  *
6  * Profiling interval timer
7  *
8  * ---------------------------------------------------------------------------*/
9
10 #if defined (PROFILING)
11
12 #include "PosixSource.h"
13 #include "Rts.h"
14 #include "Profiling.h"
15 #include "Itimer.h"
16 #include "Proftimer.h"
17
18 rtsBool do_prof_ticks = rtsFalse;       /* enable profiling ticks */
19
20 void
21 stopProfTimer(void)
22 {                               /* Stops time profile */
23     if (time_profiling) {
24         do_prof_ticks = rtsFalse;
25     }
26 };
27
28 void
29 startProfTimer(void)
30 {                               /* Starts time profile */
31     if (time_profiling) {
32         do_prof_ticks = rtsTrue;
33     }
34 };
35
36 void
37 handleProfTick(void)
38 {
39     if (do_prof_ticks) {
40         CCS_TICK(CCCS);
41     }
42 }
43 #endif /* PROFILING */