File: ETimer.i3 Last modified on Thu Dec 1 10:13:38 PST 1994 by kalsow
This interface provides a set of non-overlapping timers. The timers record elapsed time, not CPU time.
A background timer and a garbage collection timer are automatically provided.
The stack of suspended timers can contain at most 100 timers.
ETimer; IMPORT Wr; TYPE T <: REFANY; PROCEDURE New (lab: TEXT): T;
Create and return a new timer with label
PROCEDURE Relabel (t: T; lab: TEXT);
PROCEDURE Push (t: T);
Suspend the currently running timer, start
PROCEDURE Pop ();
Suspend the currently running timer, resume the previous one.
PROCEDURE Dump (wr: Wr.T);
Dump the non-zero timers to
wr. Note, the timers will be dumped in the reverse order of how they were created.
PROCEDURE Elapsed (t: T): LONGREAL;
Returns the seconds accumulated by
PROCEDURE TotalElapsed (): LONGREAL;
Returns the total elpased seconds
PROCEDURE Next (prev: T): T;
Returns the timer following
previn the global list of all timers. If
NIL, the first timer is returned. If
previs the last known timer,
PROCEDURE Enable ();
Start the timers. Note that
Enablemust be called at least once before any timers will begin accumulating time.
PROCEDURE Reset (t: T);
t's accumulator to zero.
PROCEDURE ResetAll ();
Reset all timers to zero.