diff --git a/include/ircd/date.h b/include/ircd/date.h index 852166211..28944fbd6 100644 --- a/include/ircd/date.h +++ b/include/ircd/date.h @@ -16,6 +16,7 @@ namespace ircd using microtime_t = std::pair; using steady_point = time_point; using system_point = time_point; + template using duration = std::chrono::duration; microtime_t microtime(); string_view microtime(const mutable_buffer &); @@ -45,6 +46,17 @@ namespace ircd template std::string timestr(args&&...); std::ostream &operator<<(std::ostream &, const system_point &); + template std::ostream &operator<<(std::ostream &, const duration &); +} + +template +std::ostream & +ircd::operator<<(std::ostream &s, + const duration &duration) +{ + s << duration.count(); + return s; } inline std::ostream &