Make utils::TimeStamp formattable for logs, etc.
This commit is contained in:
1 parent
99effe9f00
commit
a111b607cc
1 file changed
+6
@@ -11,7 +11,9 @@
|
||||
#include "bts_assert.h"
|
||||
#include "system/os.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <fmt/chrono.h>
|
||||
#include <limits>
|
||||
|
||||
namespace bts {
|
||||
@@ -187,6 +189,10 @@ inline bool operator<=(const TimeStamp &t1, const TimeStamp &t2) {
|
||||
return t1._time <= t2._time;
|
||||
}
|
||||
|
||||
inline auto format_as(TimeStamp ts) {
|
||||
return std::chrono::nanoseconds{ts.to_uint64()};
|
||||
}
|
||||
|
||||
} // namespace utils
|
||||
} // namespace bts
|
||||
|
||||
|
||||
Reference in new issue
Block a user