MCPcopy Create free account
hub / github.com/DavidWells/analytics / constructor

Method constructor

packages/analytics-util-queue/tests/main.test.js:183–188  ·  view source on GitHub ↗
(name = 'Benchmark')

Source from the content-addressed store, hash-verified

181
182class Timer {
183 constructor(name = 'Benchmark') {
184 this.NS_PER_SEC = 1e9
185 this.MS_PER_NS = 1e-6
186 this.name = name
187 this.startTime = process.hrtime()
188 }
189 runtimeMs() {
190 const diff = process.hrtime(this.startTime)
191 return (diff[0] * this.NS_PER_SEC + diff[1]) * this.MS_PER_NS

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected