From f603ae175b987549f5cd033bf107e1de8fb2ba78 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 11 Feb 2014 19:22:21 -0800 Subject: [PATCH] Add chrono APIs to DeadlineTimer --- modules/beast_core/thread/DeadlineTimer.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/beast_core/thread/DeadlineTimer.h b/modules/beast_core/thread/DeadlineTimer.h index 3fe462adef..e8d8540a65 100644 --- a/modules/beast_core/thread/DeadlineTimer.h +++ b/modules/beast_core/thread/DeadlineTimer.h @@ -63,8 +63,17 @@ public: will send a notification. This must be greater than zero. */ + /** @{ */ void setExpiration (double secondsUntilDeadline); + template + void setExpiration (std::chrono::duration const& amount) + { + setExpiration (std::chrono::duration_cast < + std::chrono::duration > (amount).count ()); + } + /** @} */ + /** Set the timer to go off repeatedly with the specified frequency. If the timer is already active, this will reset it. @note If the timer is already active, the old one might go off