Skip to content

Commit

Permalink
fixup! fixup! perf_hooks: complete overhaul of the implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Jan 30, 2021
1 parent 69ff2d0 commit 6651299
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/internal/perf/event_loop_delay.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
} = internalBinding('performance');

const {
validateInteger,
validateNumber,
validateObject,
} = require('internal/validators');
Expand All @@ -34,9 +35,7 @@ function monitorEventLoopDelay(options = {}) {
validateObject(options, 'options');

const { resolution = 10 } = options;
validateNumber(resolution, 'options.resolution');
if (resolution <= 0 || !NumberIsSafeInteger(resolution))
throw new ERR_INVALID_ARG_VALUE.RangeError('resolution', resolution);
validateInteger(resolution, 'options.resolution', 1);

return new ELDHistogram(new _ELDHistogram(resolution));
}
Expand Down

0 comments on commit 6651299

Please sign in to comment.