Timer object, for timing sections of code.

Hierarchy (view full)

Constructors

  • Parameters

    • Optionalunit: TimerUnit
    • Optionalfilename: string

    Returns timer

Properties

addedDefines: Set<string> = ...
filename: undefined | string
print: boolean
printUnit: boolean
timeUnits: timeUnits

Methods

  • Verifies that join point start is not undefined, that it is inside a function. Additionally, if $end is not undefined, checks if it is inside the same function as $start.

    [Requires] global attribute 'ancestor'.

    Parameters

    • $start: any
    • Optional$end: any
    • OptionalfunctionJpName: string

    Returns boolean

    True if $start is a valid join point for the 'time' function

  • Returns undefined | Joinpoint

    The last join point that was inserted after the $end mark

  • Sets the join point that should be returned by .getAfterJp().

    Parameters

    Returns void

  • Parameters

    • print: boolean

    Returns this

  • Parameters

    • printUnit: boolean

    Returns this

  • Times the code of a given section.

    Parameters

    • $start: Joinpoint

      Starting point of the time measure

    • prefix: string = ""

      Message that will appear before the time measure. If undefined, empty string will be used.

    • $end: Joinpoint = $start

      Ending point of the time measure. If undefined, measure is done around starting point.

    Returns undefined | string