| 131 | |
| 132 | template<class Function> |
| 133 | void |
| 134 | timedTest(std::size_t repeat, std::string const& name, Function&& f) |
| 135 | { |
| 136 | using namespace std::chrono; |
| 137 | using clock_type = std::chrono::high_resolution_clock; |
| 138 | log << name << std::endl; |
| 139 | for(std::size_t trial = 1; trial <= repeat; ++trial) |
| 140 | { |
| 141 | auto const t0 = clock_type::now(); |
| 142 | f(); |
| 143 | auto const elapsed = clock_type::now() - t0; |
| 144 | log << |
| 145 | "Trial " << trial << ": " << |
| 146 | duration_cast<milliseconds>(elapsed).count() << " ms" << std::endl; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | template<bool isRequest> |
| 151 | struct null_parser : |