diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-01 17:54:32 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-01 17:54:32 +0100 |
commit | 052270b2cbba325076cd5ff57b04c2df5eec2307 (patch) | |
tree | f47a587880e795801abc2e285c683b42bdcae6c9 /src/timer-ns.cpp | |
parent | 10e22ed4fb0bd21d9d268c5c6f1ac1c7d9e4b621 (diff) |
a
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 |