Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@hapi/hoek/lib/bench.js
1126 views
1
'use strict';
2
3
const internals = {};
4
5
6
module.exports = internals.Bench = class {
7
8
constructor() {
9
10
this.ts = 0;
11
this.reset();
12
}
13
14
reset() {
15
16
this.ts = internals.Bench.now();
17
}
18
19
elapsed() {
20
21
return internals.Bench.now() - this.ts;
22
}
23
24
static now() {
25
26
const ts = process.hrtime();
27
return (ts[0] * 1e3) + (ts[1] / 1e6);
28
}
29
};
30
31