timer::interval now supports std::chrono
This commit is contained in:
parent
b0392bfa3c
commit
1cbc153a3e
@ -53,7 +53,17 @@ namespace nana
|
|||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
void interval(unsigned milliseconds); ///< Set the duration between calls (millisec ??)
|
void interval(unsigned milliseconds); ///< Set the duration between calls (millisec ??)
|
||||||
|
template <typename Rep, typename Period>
|
||||||
|
inline void interval(std::chrono::duration<Rep, Period> const & time_interval) ///< Set the duration between calls, accepts std::chrono
|
||||||
|
{
|
||||||
|
interval(std::chrono::duration_cast<std::chrono::milliseconds>(time_interval).count());
|
||||||
|
}
|
||||||
unsigned interval() const;
|
unsigned interval() const;
|
||||||
|
template <typename Duration = std::chrono::milliseconds>
|
||||||
|
inline Duration interval() const
|
||||||
|
{
|
||||||
|
return std::chrono::duration_cast<Duration>(std::chrono::milliseconds(interval));
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
nana::basic_event<arg_elapse> elapse_;
|
nana::basic_event<arg_elapse> elapse_;
|
||||||
implement * const impl_;
|
implement * const impl_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user