mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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:
1 parent
8de9fe94a0
commit
0bd82c93c6
1 file changed
+1
@@ -539,6 +539,7 @@ bool ELDHistogram::RecordDelta() {
|
||||
bool ELDHistogram::Enable() {
|
||||
if (enabled_) return false;
|
||||
enabled_ = true;
|
||||
prev_ = 0;
|
||||
uv_timer_start(timer_,
|
||||
ELDHistogramDelayInterval,
|
||||
resolution_,
|
||||
|
||||
Reference in new issue
Block a user