From cf1952dbe1f268a7c62d67955aa2cec2157f8716 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 --- 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 63ef4df793c0c5..6482f5d44e4c18 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -2616,8 +2616,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) {