MCPcopy Create free account
hub / github.com/firebase/functions-samples /

Class

Node/instrument-with-opentelemetry/functions/timer.js:17–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 */
16
17exports.Timer = class {
18 /**
19 *
20 */
21 constructor() {
22 this.start = process.hrtime.bigint();
23 }
24
25 /**
26 * Get the time since this timer was constructed
27 * @return {string}
28 */
29 measureMs() {
30 const duration = process.hrtime.bigint() - this.start;
31 return (duration / 1000000).toString();
32 }
33};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected