diff options
Diffstat (limited to 'src/timer-ns.cpp')
-rw-r--r-- | src/timer-ns.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/timer-ns.cpp b/src/timer-ns.cpp index 7a2fe087..80bd29df 100644 --- a/src/timer-ns.cpp +++ b/src/timer-ns.cpp @@ -1,5 +1,6 @@ #include "timer.hpp" #include "compat/assert.hpp" +#include "compat/debug.hpp" #include <cr/Debug.h> namespace floormat { @@ -98,4 +99,14 @@ Ns::operator uint64_t() const { return stamp; } Ns::operator float() const { return float(stamp); } uint64_t Ns::operator*() const { return stamp; } +Debug& operator<<(Debug& dbg, const Ns& box) +{ + auto flags = dbg.flags(); + dbg << ""; + dbg.setFlags(flags | Debug::Flag::NoSpace); + dbg << fraction((float)((double)box.stamp * 1e-6), 1) << " ms"; + dbg.setFlags(flags); + return dbg; +} + } // namespace floormat |