<<>> <> <> <> <> <> <> <<>> DIRECTORY BasicTime, IO, Rope; CodeTimer: CEDAR DEFINITIONS = BEGIN Problem: SIGNAL [msg: Rope.ROPE]; Table: TYPE = REF TableObj; TableObj: TYPE; Interval: TYPE = REF IntervalObj; IntervalObj: TYPE; <> <<>> CreateTable: PROC [tableName: ATOM _ NIL] RETURNS [table: Table]; <> GetTable: PROC [tableName: ATOM] RETURNS [table: Table]; <> ResetTable: PROC [table: Table]; <> ResetInterval: PROC [intervalName: ATOM, table: Table]; <> <> <<>> StartInterval: PROC [intervalName: ATOM, table: Table]; StartInt: PROC [intervalName: ATOM, tableName: ATOM]; <> StopInterval: PROC [intervalName: ATOM, table: Table]; StopInt: PROC [intervalName: ATOM, tableName: ATOM]; <> SetIntMilliseconds: PUBLIC PROC [intervalName: ATOM, startTime: CARD32, stopTime: CARD32, tableName: ATOM]; <> <> <<>> ForEachTable: PROC [proc: ForEachTableProc] RETURNS [aborted: BOOL _ FALSE]; <> ForEachTableProc: TYPE = PROC [tableName: ATOM, table: Table] RETURNS [done: BOOL _ FALSE]; ForEachIntervalInContext: PROC [table: Table, proc: ForEachIntervalInContextProc] RETURNS [aborted: BOOL _ FALSE]; <> ForEachIntervalInContextProc: TYPE = PROC [intervalName: ATOM, process: CARD, starts, totalMsec, minMsec, maxMsec, maxIndex, startsWithoutStops: CARD, level: NAT _ 0] RETURNS [done: BOOL _ FALSE]; <> <> <> <> <> <> <> <> <> <<>> PrintTable: PROC [f: IO.STREAM, table: Table]; <> < is the average time spent per interval-in-context. "range" gives the times for the shortest and longest execution. "worst" is the number of times the interval had been entered when the longest execution took place. "errs" is the number of times the interval was started without being stopped.>> PrintInterval: PROC [f: IO.STREAM, intervalName: ATOM, table: Table, nestingLevel: NAT _ 0]; <> PrintInt: PROC [f: IO.STREAM, intervalName: ATOM, tableName: ATOM, nestingLevel: NAT _ 0]; <> <> <<>> TimerOn: PROC; TimerOff: PROC; <> <<>> IntervalStatistics: TYPE = REF IntervalStatisticsObj; IntervalStatisticsObj: TYPE = RECORD [ process: CARD, -- an identifier for the Cedar process that executed this interval context: LIST OF ATOM, -- the nesting of levels when this was called from innermost to outermost starts: CARD, totalMsec: CARD, minMsec: CARD, maxMsec: CARD, maxIndex: CARD, startsWithoutStops: CARD ]; GetIntervalTotals: PROC [intervalName: ATOM, table: Table] RETURNS [starts, totalMsec, averageMsec, minMsec, maxMsec, maxIndex, startsWithoutStops: CARD]; <> <<>> GetIntervalStats: PROC [intervalName: ATOM, table: Table] RETURNS [stats: LIST OF IntervalStatistics]; <> END.