From 5862d0372c26c3fe3884bcdf16eafdb3fd3a9b39 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 11 Apr 2018 13:59:26 -0700 Subject: [PATCH] http2: fix ping duration calculation Backport-PR-URL: https://github.com/nodejs/node/pull/22850 PR-URL: https://github.com/nodejs/node/pull/19956 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat --- src/node_http2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index e9a06a88635882..036decb89581c9 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -2832,8 +2832,8 @@ void Http2Session::Http2Ping::Send(uint8_t* payload) { } void Http2Session::Http2Ping::Done(bool ack, const uint8_t* payload) { - session_->statistics_.ping_rtt = (uv_hrtime() - startTime_); - double duration = (session_->statistics_.ping_rtt - startTime_) / 1e6; + session_->statistics_.ping_rtt = uv_hrtime() - startTime_; + double duration = session_->statistics_.ping_rtt / 1e6; Local buf = Undefined(env()->isolate()); if (payload != nullptr) {