33 #ifndef YB_INC_YTEST_TIMING_HPP_
34 #define YB_INC_YTEST_TIMING_HPP_ 1
62 template<
typename _fNow,
typename _fCallable,
typename... _tParams>
64 once(_fNow now, _fCallable&& f, _tParams&&... args) -> decltype(now() - now())
77 template<
typename _fCallable,
typename... _tParams>
79 once_c(_fCallable&& f, _tParams&&... args)
81 const std::clock_t cl(std::clock());
84 return double(clock() - cl) / CLOCKS_PER_SEC;
94 template<
class _fNow,
typename _fCallable,
typename... _tParams>
96 total(
size_t n, _fNow now, _fCallable&& f, _tParams&&... args)
97 -> decltype(now() - now())
101 for(
size_t i(0); i != n; ++i)
111 template<
typename _fCallable,
typename... _tParams>
113 total_c(
size_t n, _fCallable&& f, _tParams&&... args)
115 const std::clock_t cl(std::clock());
117 for(
size_t i(0); i != n; ++i)
119 return double(clock() - cl) / CLOCKS_PER_SEC;
127 template<
typename... _tParams>