{"id":26745560,"url":"https://github.com/nbdy/timerpp","last_synced_at":"2025-10-29T20:41:51.768Z","repository":{"id":57475612,"uuid":"427824719","full_name":"nbdy/timerpp","owner":"nbdy","description":"single header timer library","archived":false,"fork":false,"pushed_at":"2021-12-22T15:42:39.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T19:16:42.411Z","etag":null,"topics":["header-only","python-bindings","soft-timer","timer"],"latest_commit_sha":null,"homepage":"","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/nbdy.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}},"created_at":"2021-11-14T03:05:48.000Z","updated_at":"2021-12-22T15:43:59.000Z","dependencies_parsed_at":"2022-09-07T17:12:54.566Z","dependency_job_id":null,"html_url":"https://github.com/nbdy/timerpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Ftimerpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Ftimerpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Ftimerpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Ftimerpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbdy","download_url":"https://codeload.github.com/nbdy/timerpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991561,"owners_count":20706129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["header-only","python-bindings","soft-timer","timer"],"created_at":"2025-03-28T08:17:35.326Z","updated_at":"2025-10-29T20:41:46.722Z","avatar_url":"https://github.com/nbdy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timerpp\n\n# features\n\n- [X] header only\n- [X] [tested](tests.cpp)\n- [X] no dependencies\n- [X] python bindings\n  - `pip3 install git+https://github.com/nbdy/timerpp`\n  - `pip3 install timerpp`\n\n# example\n\n## cpp\n\n```c++\n#include \"timerpp.h\"\n#include \u003ciostream\u003e\n\nint main() {\n  uint64_t lastTimestamp = TIMESTAMP_MS;\n  uint64_t newTimestamp = 0;\n  uint32_t x = 0;\n  timerpp::Timer t([\u0026x, \u0026newTimestamp, \u0026lastTimestamp]{\n    newTimestamp = TIMESTAMP_MS;\n    x += newTimestamp - lastTimestamp;\n    lastTimestamp = newTimestamp;\n  });\n\n  t.start(500);\n  std::this_thread::sleep_for(Milliseconds(1501));\n  t.stop();\n\n  std::cout \u003c\u003c \"1500 == \" \u003c\u003c  x \u003c\u003c std::endl;\n\n  return 0;\n}\n```\n\n## python\n\n```python\nfrom timerpp import Timer\nfrom time import sleep\n\n\nclass Example(Timer):\n  elapsed_ms = 0\n\n  def __init__(self):\n    Timer.__init__(self, self.callback, 500)\n\n  def callback(self):\n    self.elapsed_ms += 500\n\n\ne = Example()\ne.start()\nsleep(1.49)\ne.stop()\nprint(f\"elapsed_ms: {e.elapsed_ms}\")\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbdy%2Ftimerpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbdy%2Ftimerpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbdy%2Ftimerpp/lists"}