| 5 | |
| 6 | template <typename F> |
| 7 | auto timeInvocation(F&& func) -> std::pair<std::chrono::nanoseconds, decltype(func())> { |
| 8 | auto begin = std::chrono::high_resolution_clock::now(); |
| 9 | auto result = func(); |
| 10 | auto end = std::chrono::high_resolution_clock::now(); |
| 11 | return std::make_pair(std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin), result); |
| 12 | } |