reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofTimer.h
Go to the documentation of this file.
1#pragma once
2
3#include "ofConstants.h"
4#include "ofUtils.h"
5
6class ofTimer {
7public:
8
10 ofTimer();
11
13 void reset();
14
20 void setPeriodicEvent(uint64_t nanoseconds);
21
23 void waitNext();
24private:
25 void calculateNextPeriod();
26 std::chrono::nanoseconds nanosPerPeriod;
27#if defined(TARGET_WIN32)
28 LARGE_INTEGER nextWakeTime;
29 HANDLE hTimer;
30#else
31 ofTime nextWakeTime;
32#endif
33};
34
Definition ofTimer.h:6
void waitNext()
Sleep this thread until the next periodic event.
Definition ofTimer.cpp:30
ofTimer()
Constructs the default ofTimer().
Definition ofTimer.cpp:7
void reset()
Reset the starting instant of the periodic event to now.
Definition ofTimer.cpp:16
void setPeriodicEvent(uint64_t nanoseconds)
Sets the frequency in nanoseconds that events happen.
Definition ofTimer.cpp:25
Definition ofUtils.h:101