{"id":37063251,"url":"https://github.com/prince-ravi-leow/simpler_timer","last_synced_at":"2026-01-14T07:04:10.641Z","repository":{"id":226028057,"uuid":"767527617","full_name":"prince-ravi-leow/simpler_timer","owner":"prince-ravi-leow","description":"⏱️  A simple interactive-first timer for all your Python timekeeping needs","archived":false,"fork":false,"pushed_at":"2024-08-25T15:06:38.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T21:55:39.733Z","etag":null,"topics":["interactive","object-oriented-programming","oop","python","timer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prince-ravi-leow.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":"2024-03-05T13:06:35.000Z","updated_at":"2024-08-25T15:06:41.000Z","dependencies_parsed_at":"2024-05-13T10:26:44.143Z","dependency_job_id":"e19cd359-b8b4-4a2e-9343-c26fc9240d11","html_url":"https://github.com/prince-ravi-leow/simpler_timer","commit_stats":null,"previous_names":["prince-ravi-leow/simpler_timer","prince-ravi-leow/simplertimer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prince-ravi-leow/simpler_timer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince-ravi-leow%2Fsimpler_timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince-ravi-leow%2Fsimpler_timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince-ravi-leow%2Fsimpler_timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince-ravi-leow%2Fsimpler_timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prince-ravi-leow","download_url":"https://codeload.github.com/prince-ravi-leow/simpler_timer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince-ravi-leow%2Fsimpler_timer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["interactive","object-oriented-programming","oop","python","timer"],"created_at":"2026-01-14T07:04:09.976Z","updated_at":"2026-01-14T07:04:10.636Z","avatar_url":"https://github.com/prince-ravi-leow.png","language":"Python","readme":"# ⏱️ `simpler_timer`: a simple interactive-first timer for all your Python timekeeping needs \n# ❗️ TL;DR - for the impatient...\n```py\nfrom simpler_timer import SimplerTimer\ntimer = SimplerTimer()\ntimer.end()\n```\nSimple as that. Batteries included - no dependencies required. 🔋\n\n# ⬇️ Installation\nSimply `pip install`\n```sh\n$ pip install simpler-timer\n```\n\nFor development version\n```sh\n$ git clone https://github.com/prince-ravi-leow/simpler_timer.git \u0026\u0026 cd simpler_timer/\n$ pip install -e .\n```\n\n# ⚡️ Simple usage\nSay you want to time a simple operation. \n\nFirst, import:\n```py\nfrom simpler_timer import SimplerTimer\n```\nSimply create a `SimplerTimer` object, run your operation(s), and call `.end()` to stop the timer and return elapsed time in seconds.\n\nFrom there, use the `.report()` method to print a nicely formatted timestamp.\n```py \n\u003e\u003e\u003e timer = SimplerTimer()\n\u003e\u003e\u003e some_operation()\n\u003e\u003e\u003e some_other_operation()\n\u003e\u003e\u003e timer.end()\n0:00:15.005237\n\u003e\u003e\u003e timer.report()\nElapsed time (H:MM:SS.ff): 0:00:15.005237\n```\n\nWant to recall the non-formatted time in seconds? *Easy*:\n```py\n\u003e\u003e\u003e elapsed_time = timer.recall()\n\u003e\u003e\u003e elapsed_time\n15.005237\n```\n\n# 🍬 Other goodies\n## Monitor timer status / progress\nUse `.status` attribute or Boolean evaluation with `.is_active()` method:\n```py\n\u003e\u003e\u003e timer = SimplerTimer()\n\u003e\u003e\u003e timer.is_active()\nTrue\n\u003e\u003e\u003e timer.end()\n\u003e\u003e\u003e timer.status\n'Inactive'\n```\nGet progress readout of active timer:\n\n```py\n\u003e\u003e\u003e timer.start()\n\u003e\u003e\u003e timer.progress()\n2.3714890480041504\n\u003e\u003e\u003e timer.progress()\n5.502876043319702\n\u003e\u003e\u003e timer.progress()\n13.753906011581421\n```\n## Pause / resume\nDoes what it says on the tin:\n```py\n\u003e\u003e\u003e timer = SimpleTimer()\n\u003e\u003e\u003e timer.pause()\n\u003e\u003e\u003e timer.is_active()\nTrue\n\u003e\u003e\u003e timer.resume()\n\u003e\u003e\u003e timer.status\n'Active (resumed)'\n```\n\u003e *Note that pausing/resuming affects `.status` attribute, but `.is_active()` evaluates as `True`.*\n## Timestamps for humans\nTired of reporting execution times with a bazillion decimal places?\n\nWorry no more - use `strip = True` to purge those pesky trailing digits with extreme prejudice.\n```py\n\u003e\u003e\u003e timer.end()\n31.928856\n\u003e\u003e\u003e timer.report(strip = True)\n'Elapsed time (H:MM:SS): 0:00:31'\n\u003e\u003e\u003e timer.timestamp(strip = True)\n0:00:31\n```\n\u003e *Currently only works for inactive timer with `.report()` and `.timestamp()` methods*.\n\n# ⛔️ What this tool is *not* (...or more specifically what it *is*)\nThis is *not* a command line utility.\n\nI originally designed the `SimplerTimer` class for use in Python scripts / pipelines, where execution time could be calculated and reported in 2 short, ultra-readable statements. However, it tends to work great for interactive sessions, as having a single 'timer' object saves the headache of having to keep track of multiple intermediate variables. \n\nWhile it's great for use within scripts and interactive sessions, this tool does not support being run FROM a CLI - and it most likely never will. Reason for this, is that the most simple and reliable version of this already exists in the the UNIX utility [`/usr/bin/time`](https://medium.com/hackernoon/usr-bin-time-not-the-command-you-think-you-know-34ac03e55cc3). If you want a proper **benchmarking** tool, Python's own [`timeit`](https://docs.python.org/3/library/timeit.html) will serve you well - and works both in interactive sessions, and as a command line utility. \n\nHonourable mention to `PowerShell` [`Measure-Command`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/measure-command?view=powershell-7.4) for our Windows friends.\n\n🐣 *Pssst - as an easter-egg, I've included the function that inspired this project: `simplerer_timer()`. This is an ultra-stripped down implementation, if all you want is a timer that starts, stops and reports elapsed time (inspect docstrings for usage)* \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprince-ravi-leow%2Fsimpler_timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprince-ravi-leow%2Fsimpler_timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprince-ravi-leow%2Fsimpler_timer/lists"}