Skip to content

ivanmari/timercpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timercpp

Thread based timer

This fork uses a single thread per timer. The timer mode can be PERIODIC or ONESHOT. This is a parameter passed to the constructor.

If the timer goes out of scope, it will stop and join the implementation thread.

Timer t ([&]() {
    cout << "Hey.. After each 1s..." << endl;
}, 1000ms, Mode::PERIODIC); 

How to compile sample program?

g++ sample.cpp -std=c++14 -pthread

License

MIT

About

Simple C++ timer using std::thread and std::chrono libraries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%