From 95eaf254c98d7f5e9e767b92642220bf455e8927 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 30 Jun 2015 07:19:35 -0700 Subject: [PATCH] Tidy up abstract_clock: * Add clock_type * Make elapsed() const --- beast/chrono/abstract_clock.h | 3 ++- beast/chrono/manual_clock.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/beast/chrono/abstract_clock.h b/beast/chrono/abstract_clock.h index 6f2c83038..38d843711 100644 --- a/beast/chrono/abstract_clock.h +++ b/beast/chrono/abstract_clock.h @@ -61,6 +61,7 @@ public: using period = typename Clock::period; using duration = typename Clock::duration; using time_point = typename Clock::time_point; + using clock_type = Clock; static bool const is_steady = Clock::is_steady; @@ -70,7 +71,7 @@ public: virtual time_point now() const = 0; /** Returning elapsed ticks since the epoch. */ - rep elapsed() + rep elapsed() const { return now().time_since_epoch().count(); } diff --git a/beast/chrono/manual_clock.h b/beast/chrono/manual_clock.h index 0c31d5812..c3652d330 100644 --- a/beast/chrono/manual_clock.h +++ b/beast/chrono/manual_clock.h @@ -21,6 +21,7 @@ #define BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED #include +#include namespace beast {