diff --git a/include/ircd/util/timer.h b/include/ircd/util/timer.h index 302de80cc..b347fecf2 100644 --- a/include/ircd/util/timer.h +++ b/include/ircd/util/timer.h @@ -27,6 +27,8 @@ struct ircd::util::timer bool stopped() const; template duration get() const; template duration at() const; + string_view pretty(const mutable_buffer &out, const int &fmt = 0) const; + std::string pretty(const int &fmt = 0) const; void cont(); void stop(); diff --git a/ircd/util.cc b/ircd/util.cc index a66207676..ef1a36269 100644 --- a/ircd/util.cc +++ b/ircd/util.cc @@ -524,6 +524,21 @@ ircd::util::timer::cont() start = clock::now(); } +std::string +ircd::util::timer::pretty(const int &fmt) +const +{ + return util::pretty(at(), fmt); +} + +ircd::string_view +ircd::util::timer::pretty(const mutable_buffer &out, + const int &fmt) +const +{ + return util::pretty(out, at(), fmt); +} + bool ircd::util::timer::stopped() const