Timer object, for timing sections of code.

Type Parameters

Hierarchy

  • timerBase

    Constructors

    Properties

    filename: undefined | string
    print: boolean = true
    printUnit: boolean = true
    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
      • functionJpName: string = "function"

      Returns boolean

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

    • Times the code of a given section.

      Parameters

      • $start: T

        Starting point of the time measure

      • Optionalprefix: string

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

      • Optional$end: T

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

      Returns undefined | string

      Name of the variable that contains the value of the elapsed time.