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