diff options
Diffstat (limited to 'include/mbgl/util/timer.hpp')
-rw-r--r-- | include/mbgl/util/timer.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/mbgl/util/timer.hpp b/include/mbgl/util/timer.hpp new file mode 100644 index 0000000000..932bb47950 --- /dev/null +++ b/include/mbgl/util/timer.hpp @@ -0,0 +1,30 @@ +#ifndef MBGL_UTIL_TIMER +#define MBGL_UTIL_TIMER + +#include <mbgl/util/noncopyable.hpp> +#include <mbgl/util/chrono.hpp> + +#include <memory> +#include <functional> + +namespace mbgl { +namespace util { + +class Timer : private util::noncopyable { +public: + Timer(); + ~Timer(); + + void start(Duration timeout, Duration repeat, std::function<void()>&&); + void stop(); + void unref(); + +private: + class Impl; + std::unique_ptr<Impl> impl; +}; + +} +} + +#endif |