Skip to content

Commit

Permalink
add timer repeat.
Browse files Browse the repository at this point in the history
  • Loading branch information
wlgq2 committed Jun 11, 2019
1 parent 0be8e6a commit de0c59b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion uv/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Author: [email protected]
Last modified: 2018-4-24
Last modified: 2019-6-11
Description: https://github.com/wlgq2/libuv_cpp11
*/
Expand Down Expand Up @@ -31,6 +31,7 @@ class Timer

void start();
void close(TimerCloseComplete callback);
void setTimerRepeat(uint64_t ms);

private:
bool started_;
Expand Down Expand Up @@ -104,6 +105,12 @@ inline void Timer<ValueType>::close(TimerCloseComplete callback)
}
}

template<typename ValueType>
inline void Timer<ValueType>::setTimerRepeat(uint64_t ms)
{
::uv_timer_set_repeat(handle_, ms);
}

template<typename ValueType>
inline void Timer<ValueType>::onTimeOut()
{
Expand Down

0 comments on commit de0c59b

Please sign in to comment.