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 details)
File details
Details for the file timerpp-0.1.tar.gz
.
File metadata
- Download URL: timerpp-0.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84c31f6272151579d32182cb0ac98f4de2e25d17cda779598b1d61a641031973 |
|
MD5 | a6df8d62d368ca3c6bdf3e2f66f21351 |
|
BLAKE2b-256 | e06ca46f8551a7d6a92172da5c454cba954d6ec8cab259fc91be5200165613b7 |