summaryrefslogtreecommitdiff
path: root/include/mbgl/util/timer.hpp
blob: 932bb47950a32176c949ac32b9e5759e0f3ff7cc (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
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