summaryrefslogtreecommitdiff
path: root/include/mbgl/util/timer.hpp
blob: 783241847d1f2523279b5e237580bb4f81e65a2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#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();

private:
    class Impl;
    std::unique_ptr<Impl> impl;
};

} // namespace util
} // namespace mbgl

#endif