{"id":21229986,"url":"https://github.com/frklan/libredeo","last_synced_at":"2026-05-19T08:02:37.141Z","repository":{"id":178549501,"uuid":"163220595","full_name":"frklan/libredeo","owner":"frklan","description":"A C++ intervall timer lib","archived":false,"fork":false,"pushed_at":"2019-07-27T21:27:10.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-02T23:16:11.431Z","etag":null,"topics":["cpp","cpp17","intervall","library","timer"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frklan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-26T21:54:19.000Z","updated_at":"2019-07-27T21:27:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"0bcea14c-f59f-49f9-8a3e-09d38fe942ca","html_url":"https://github.com/frklan/libredeo","commit_stats":null,"previous_names":["frklan/libredeo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/frklan/libredeo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frklan%2Flibredeo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frklan%2Flibredeo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frklan%2Flibredeo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frklan%2Flibredeo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frklan","download_url":"https://codeload.github.com/frklan/libredeo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frklan%2Flibredeo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33207500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:54:09.561Z","status":"ssl_error","status_checked_at":"2026-05-19T07:54:08.508Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp17","intervall","library","timer"],"created_at":"2024-11-20T23:31:03.053Z","updated_at":"2026-05-19T08:02:37.102Z","avatar_url":"https://github.com/frklan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libredeo\n\nTrying to make an intervall timer in C++ was harder than I imagined. Taking different use cases into account; many timers firing simultaneous, timers created within another timer event, canceling timers, and so on and so forth. \n\nAfter many attempts and reworks (just look at the git history), I'm fairly happy with this implementation, it still depends on multiple threads and will most probably segfault if it's pushed it to hard.\n\n## Compiling\n\nMade on macOS, should compile on Linux as well. I'm not interested in Windows so I have no idea if it compiles or not (I guess it will not).\n\n1. Clone the repo\n2. run ```make examples``` to build the test/demo app or, use ```make``` to build only the lib\n3. ```make install``` installs the lib into ```/usr/local/lib```, use ```make DESTDIR=...```to install it at another location\n\n## Using\n\n### Intervall timer\n\nTo create a repeating timer we can do like so:\n\n```C++\n#include \u003ciostream\u003e\n#include \u003clibredeo/intervall.h\u003e\n\nusing namespace std::chrono_literals;\nusing namespace yellowfortyfourcom;\n\nint main(int argc, char* argv[]) {\n  auto intervall = 5s;\n  auto repeats = 7;\n  \n  auto id = IntervallTimer::make_intervall(intervall, [](){ std::clog \u003c\u003c \"Timer event\\n\"; }, repeats);\n  IntervallTimer::wait();\n\n  return 0;\n}\n```\n\nThe timer will fire 7 times, every five-seconds.\n\n## Once shot timer\n\nA one shot timer can be created with ```IntervallTimer::make_timer(...)```:\n\n```C++\n#include \u003ciostream\u003e\n#include \u003clibredeo/intervall.h\u003e\n\nusing namespace std::chrono_literals;\nusing namespace yellowfortyfourcom;\n\nint main(int argc, char* argv[]) {\n  auto intervall = 5s;\n\n  auto id = IntervallTimer::make_timer(intervall, [](){ std::clog \u003c\u003c \"Timer event\\n\"; });\n  IntervallTimer::wait();\n\n  return 0;\n}\n```\n\n### Cancel timer(s)\n\nA timer can be cancelled by calling ```IntervallTimer::cancel_timer(id)```, we can cancel all timers with a call to ```IntervallTimer::cancel_timer()```.\n\nNote: if the timer callback is currently running, it will not be terminated when cancelling the timer.\n\n## Contributing\n\nContributions are always welcome!\n\nWhen contributing to this repository, please first discuss the change you wish to make via the issue tracker, email, or any other method with the owner of this repository before making a change.\n\nPlease note that we have a code of conduct, you are required to follow it in all your interactions with the project.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/frklan/libredeo/tags).\n\n## Authors\n\n* **Fredrik Andersson** - *Initial work* - [frklan](https://github.com/frklan)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrklan%2Flibredeo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrklan%2Flibredeo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrklan%2Flibredeo/lists"}