perf_hooks: reset prev_ before starting ELD timer

reset `ELDHistogram.prev_` before staring timer to ensure that start
timer doesn't leak across `disable()` `enable()` calls.

PR-URL: https://github.com/nodejs/node/pull/26693
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
Gerhard Stoebich authored and Michaël Zasso committed 2019-03-27 22:10:29 +01:00
1 parent 8de9fe94a0
commit 0bd82c93c6
1 file changed
+1
+1
View File
@@ -539,6 +539,7 @@ bool ELDHistogram::RecordDelta() {
bool ELDHistogram::Enable() {
if (enabled_) return false;
enabled_ = true;
prev_ = 0;
uv_timer_start(timer_,
ELDHistogramDelayInterval,
resolution_,