Proftimer.c 809 Bytes
Newer Older
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 7 8 9 10 11 12
 *
 * Profiling interval timer
 *
 * ---------------------------------------------------------------------------*/

#if defined (PROFILING)

#include "Rts.h"
13
#include "Profiling.h"
14 15 16
#include "Itimer.h"
#include "Proftimer.h"

17
rtsBool do_prof_ticks = rtsFalse;       /* enable profiling ticks */
18 19 20 21

void
stopProfTimer(void)
{				/* Stops time profile */
22 23 24
    if (time_profiling) {
	do_prof_ticks = rtsFalse;
    }
25 26 27 28 29
};

void
startProfTimer(void)
{				/* Starts time profile */
30 31 32
    if (time_profiling) {
	do_prof_ticks = rtsTrue;
    }
33 34
};

35 36 37 38 39 40 41
void
handleProfTick(void)
{
    if (do_prof_ticks) {
	CCS_TICK(CCCS);
    }
}
42
#endif /* PROFILING */