summaryrefslogtreecommitdiffhomepage
path: root/compat/timer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'compat/timer.hpp')
-rw-r--r--compat/timer.hpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/compat/timer.hpp b/compat/timer.hpp
index d162a949..c107d28d 100644
--- a/compat/timer.hpp
+++ b/compat/timer.hpp
@@ -12,30 +12,23 @@
#include "time.hpp"
#include <ctime>
+#include <cstdint>
#include <type_traits>
struct OTR_COMPAT_EXPORT Timer final
{
- using time_type = time_t;
+ using time_type = std::int64_t;
Timer();
void start();
- template<typename t>
- constexpr auto elapsed() const
- {
- 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);
- time_type conv_nsecs(const struct timespec& cur) const;
+ struct timespec gettime_() const;
using ns = time_units::ns;
};