Skip to content

Commit 6651299

Browse files
committed
fixup! fixup! perf_hooks: complete overhaul of the implementation
1 parent 69ff2d0 commit 6651299

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/internal/perf/event_loop_delay.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const {
99
} = internalBinding('performance');
1010

1111
const {
12+
validateInteger,
1213
validateNumber,
1314
validateObject,
1415
} = require('internal/validators');
@@ -34,9 +35,7 @@ function monitorEventLoopDelay(options = {}) {
3435
validateObject(options, 'options');
3536

3637
const { resolution = 10 } = options;
37-
validateNumber(resolution, 'options.resolution');
38-
if (resolution <= 0 || !NumberIsSafeInteger(resolution))
39-
throw new ERR_INVALID_ARG_VALUE.RangeError('resolution', resolution);
38+
validateInteger(resolution, 'options.resolution', 1);
4039

4140
return new ELDHistogram(new _ELDHistogram(resolution));
4241
}

0 commit comments

Comments
 (0)