calc-response-time

    2.0.0 • Public • Published

    calc-response-time

    Calculates roundtrip time of a service call. Returns response time in seconds or milliseconds.

    Usage

    const { initTimer, getResponseTime } = require("calc-response-time");
     
    const start = initTimer();
     
    // do something
     
    const t = getResponseTime(start, { units: "s" }); // default is `ms`
     
    // Examples
    // 1.054; // for `s`
    // 1054; // for `ms`

    Keywords

    none

    Install

    npm i calc-response-time

    DownloadsWeekly Downloads

    7

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    2.99 kB

    Total Files

    4

    Last publish

    Collaborators

    • s14k51