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

    Constructors

    Properties

    log: Logger
    defaultLogger: Logger | "@legacy" = '@legacy'

    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 } }

    • Builds a Server-Timing header value from finished sections. Returns an empty string when no finished section remains.

      Returns string

    • 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
      • TName extends string

      Parameters

      • section: TimingSectionName<TName>

        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