calc-response-time
v2.0.0
Published
Calculates roundtrip time of a service call. Returns response time in seconds or milliseconds.
Downloads
11
Readme
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`