18template <
class Rep,
class Period>
19struct Timed<std::chrono::duration<Rep, Period>> {
21 time -= std::chrono::steady_clock::now().time_since_epoch();
23 ~Timed() {
time += std::chrono::steady_clock::now().time_since_epoch(); }
28 std::chrono::duration<Rep, Period> &
time;
36template <
class T,
class F,
class... Args>
37decltype(
auto)
timed(T &time, F &&func, Args &&...args) {
39 return std::invoke(std::forward<F>(func), std::forward<Args>(args)...);
decltype(auto) timed(T &time, F &&func, Args &&...args)
std::chrono::duration< Rep, Period > & time
Timed(const Timed &)=delete
Timed & operator=(const Timed &)=delete
Timed & operator=(Timed &&)=delete
Timed(std::chrono::duration< Rep, Period > &time)