This new code can be used for rendering on the Main thread while it will also work for rendering on the Map thread before we make the switch. Needed by #2909.
30 lines
476 B
C++
30 lines
476 B
C++
#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
|