2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_TEST_THROUGHPUT_HPP
11 #define BOOST_BEAST_TEST_THROUGHPUT_HPP
23 std::chrono::system_clock;
25 clock_type::time_point when_;
32 : when_(clock_type::now())
39 return clock_type::now() - when_;
45 throughput(std::chrono::duration<
46 double> const& elapsed, std::uint64_t items)
48 using namespace std::chrono;
49 return static_cast<std::uint64_t>(
50 1 / (elapsed/items).count());