From d197d115dcf29f4ade55e0f5d155d34338dce4e7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 14 Aug 2015 22:44:14 +0900 Subject: [PATCH] h2load: Use floating point duration cast --- src/h2load.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 7eebaecf..56bebb27 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -1683,9 +1683,10 @@ int main(int argc, char **argv) { double rps = 0; int64_t bps = 0; if (duration.count() > 0) { - auto secd = static_cast(duration.count()) / (1000 * 1000); - rps = stats.req_success / secd; - bps = stats.bytes_total / secd; + auto secd = std::chrono::duration_cast< + std::chrono::duration>(duration); + rps = stats.req_success / secd.count(); + bps = stats.bytes_total / secd.count(); } std::cout << R"(