Keeta LogoKeeta Logo@keetanetwork/keetanet-client
    Preparing search index...
    Index

    Constructors

    Properties

    log: Console = RequestTiming.defaultLogger
    defaultLogger: Console = console

    Methods

    • Returns number

    • Parameters

      Returns void

    • Parameters

      • section: undefined | string
      • Optionaldeduplicate: boolean

      Returns void

      Use endTime(section: symbol) instead

    • Returns { [section: string]: { duration: number; name: string } }

    • Type Parameters

      • T

      Parameters

      • section: string
      • code: () => Promise<T>

      Returns Promise<T>

    • Start timing a section of code

      Parameters

      • section: string

        Name of the section to time -- should be unique within the code base so that it can be identified later

      Returns DisposableTimingHandle

      A handle which can be used to end the timing section

    • Run a piece of code and time it, returning the result of the code

      This takes an optional "timing" parameter which is a timing object if one exists, to update -- if this parameter is undefined no timing will be done.

      Type Parameters

      • T

      Parameters

      • section: string

        Name of the section to time -- should be unique within the code base so that it can be identified later

      • timing: undefined | RequestTiming

        Timing object to update, if available

      • code: () => Promise<T>

        The code to run

      Returns Promise<T>

      The result of the code