Make utils::TimeStamp formattable for logs, etc.

This commit is contained in:
John Colvin committed 2024-10-21 14:48:11 +00:00
1 parent 99effe9f00
commit a111b607cc
1 file changed
+6
+6
View File
@@ -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