ad5bbd92072c7235f9b955d5c0784e1a71ab4e5f
[ghc-hetmet.git] / ghc / rts / Proftimer.c
1 /* -----------------------------------------------------------------------------
2  * $Id: Proftimer.c,v 1.5 1999/08/25 16:11:49 simonmar Exp $
3  *
4  * (c) The GHC Team, 1998-1999
5  *
6  * Profiling interval timer
7  *
8  * ---------------------------------------------------------------------------*/
9
10 /* Only have cost centres etc if PROFILING defined */
11
12 #if defined (PROFILING)
13
14 #include "Rts.h"
15 #include "ProfRts.h"
16 #include "Itimer.h"
17 #include "Proftimer.h"
18
19 nat current_interval = 1;               /* Current interval number -- 
20                                            stored in AGE */
21
22 nat interval_ticks = DEFAULT_INTERVAL;  /* No of ticks in an interval */
23
24 nat previous_ticks = 0;                 /* ticks in previous intervals */
25 nat current_ticks = 0;                  /* ticks in current interval */
26
27 void
28 stopProfTimer(void)
29 {                               /* Stops time profile */
30   if (time_profiling) {
31     do_prof_ticks = rtsFalse;
32   }
33 };
34
35 void
36 startProfTimer(void)
37 {                               /* Starts time profile */
38   if (time_profiling) {
39     do_prof_ticks = rtsTrue;
40   }
41 };
42
43 #endif /* PROFILING */