wretch
    Preparing search index...

    Variable perfsAddonConst

    perfsAddon: () => WretchAddon<unknown, PerfsAddon> = ...

    Adds the ability to measure requests using the Performance Timings API.

    Uses the Performance API (browsers & node.js) to expose timings related to the underlying request.

    Browser timings are very accurate, node.js only contains raw measures.

    import PerfsAddon from "wretch/addons/perfs"

    // Use perfs() before the response types (text, json, ...)
    wretch("...")
    .addon(PerfsAddon())
    .get()
    .perfs((timings) => {
    // Will be called when the timings are ready.
    console.log(timings.startTime);
    })
    .res();

    Type Declaration