summaryrefslogtreecommitdiffhomepage
path: root/compat/timer.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-08-03 04:43:28 +0000
committerStanislaw Halik <sthalik@misaki.pl>2018-08-04 13:41:56 +0000
commitc172c327c2b927427c24a7e3a5f345673d0e5929 (patch)
treed1e2d0a1fcb3619bfa0b453b743db78b37e2b727 /compat/timer.hpp
parente841b3324655b5862dc6d79d482b2af474239791 (diff)
logic/pipeline: rotation order fixrevert-geometry-stuff
v2: fix comments v3: fix reltrans
Diffstat (limited to 'compat/timer.hpp')
-rw-r--r--compat/timer.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/compat/timer.hpp b/compat/timer.hpp
index 26e612b0..d162a949 100644
--- a/compat/timer.hpp
+++ b/compat/timer.hpp
@@ -22,16 +22,17 @@ struct OTR_COMPAT_EXPORT Timer final
void start();
template<typename t>
- t elapsed() const
+ constexpr auto elapsed() const
{
- using namespace time_units;
- return time_cast<t>(ns(elapsed_nsecs()));
+ using ns = time_units::ns;
+ return t{ns{elapsed_nsecs()}};
}
time_type elapsed_nsecs() const;
double elapsed_usecs() const;
double elapsed_ms() const;
double elapsed_seconds() const;
+
private:
struct timespec state {};
static void gettime(struct timespec* state);