0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd: Add template ostream convenience for std::chrono::durations.

This commit is contained in:
Jason Volk 2018-05-23 17:58:11 -07:00
parent 5708d9c36b
commit 31dfee9bf3

View file

@ -16,6 +16,7 @@ namespace ircd
using microtime_t = std::pair<time_t, int32_t>;
using steady_point = time_point<steady_clock>;
using system_point = time_point<system_clock>;
template<class rep, class period> using duration = std::chrono::duration<rep, period>;
microtime_t microtime();
string_view microtime(const mutable_buffer &);
@ -45,6 +46,17 @@ namespace ircd
template<class... args> std::string timestr(args&&...);
std::ostream &operator<<(std::ostream &, const system_point &);
template<class rep, class period> std::ostream &operator<<(std::ostream &, const duration<rep, period> &);
}
template<class rep,
class period>
std::ostream &
ircd::operator<<(std::ostream &s,
const duration<rep, period> &duration)
{
s << duration.count();
return s;
}
inline std::ostream &