#include #include #include namespace mbgl { namespace util { class Timer::Impl { public: Impl() : timer(reinterpret_cast(RunLoop::getLoopHandle())) { } uv::timer timer; }; Timer::Timer() : impl(std::make_unique()) { } Timer::~Timer() { } void Timer::start(Duration timeout, Duration repeat, std::function&& cb) { impl->timer.start(std::chrono::duration_cast(timeout).count(), std::chrono::duration_cast(repeat).count(), std::move(cb)); } void Timer::stop() { impl->timer.stop(); } void Timer::unref() { impl->timer.unref(); } } }