1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.getDiff = void 0;
|
4 | const perf_hooks_1 = require("perf_hooks");
|
5 | function getDiff(cycles, callback, setup) {
|
6 | const setupData = setup && setup();
|
7 | const startTS = perf_hooks_1.performance.now();
|
8 | while (cycles-- > 0) {
|
9 | callback(setupData);
|
10 | }
|
11 | return perf_hooks_1.performance.now() - startTS;
|
12 | }
|
13 | exports.getDiff = getDiff;
|