Add chrono APIs to DeadlineTimer

This commit is contained in:
Vinnie Falco
2014-02-11 19:22:21 -08:00
parent f62d034692
commit f603ae175b

View File

@@ -63,8 +63,17 @@ public:
will send a notification. This must be
greater than zero.
*/
/** @{ */
void setExpiration (double secondsUntilDeadline);
template <class Rep, class Period>
void setExpiration (std::chrono::duration <Rep, Period> const& amount)
{
setExpiration (std::chrono::duration_cast <
std::chrono::duration <double>> (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