timer class
Project description
timerpp
features
- header only
- tested
- no dependencies
- python bindings
example
#include "timerpp.h"
#include <iostream>
int main() {
uint64_t lastTimestamp = TIMESTAMP_MS;
uint64_t newTimestamp = 0;
uint32_t x = 0;
timerpp::Timer t([&x, &newTimestamp, &lastTimestamp]{
newTimestamp = TIMESTAMP_MS;
x += newTimestamp - lastTimestamp;
lastTimestamp = newTimestamp;
});
t.start(500);
std::this_thread::sleep_for(Milliseconds(1501));
t.stop();
std::cout << "1500 == " << x << std::endl;
return 0;
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
timerpp-0.1.tar.gz
(2.7 kB
view hashes)