{"id":18341758,"url":"https://github.com/jerluc/sw","last_synced_at":"2026-03-02T03:04:29.847Z","repository":{"id":254766459,"uuid":"847472824","full_name":"jerluc/sw","owner":"jerluc","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-26T07:30:06.000Z","size":6,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T06:34:47.395Z","etag":null,"topics":["command-line-tool","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jerluc.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-08-25T23:04:42.000Z","updated_at":"2024-08-28T03:05:22.000Z","dependencies_parsed_at":"2024-08-26T01:15:38.412Z","dependency_job_id":"7270f94d-21a5-4588-a6ba-32109e04818a","html_url":"https://github.com/jerluc/sw","commit_stats":null,"previous_names":["jerluc/sw"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jerluc/sw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerluc","download_url":"https://codeload.github.com/jerluc/sw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerluc%2Fsw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["command-line-tool","rust"],"created_at":"2024-11-05T20:28:23.658Z","updated_at":"2026-03-02T03:04:29.831Z","avatar_url":"https://github.com/jerluc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `sw` (stopwatch)\n\n`sw` is a simple command-line program inspired by [GNU `time`](https://www.gnu.org/software/time/)\nthat times the execution of a shell command. Unlike GNU `time` however, `sw` also automatically\nrecords historical timing statistics so you can see things like minimum, maximum, mean, and standard\ndeviation of historical runs of the same shell command over time.\n\n## Installation\n\nTo get started, install `sw` from source:\n\n```shell\n# Directly from Github\ncargo install --git https://github.com/jerluc/sw.git\n\n# Or from local source\ngit clone https://github.com/jerluc/sw.git \u0026\u0026 cd sw/ \u0026\u0026 cargo install --path .\n```\n\n## Usage\n\nTo use `sw`, simply use it like the `time` command:\n\n```\nsw \u003cCOMMAND\u003e [COMMAND_ARGS...]\n```\n\nFor example, the first time you run, you'll see the timing for the command:\n\n```shell\nsw sleep 1\n# Took 1.002365579s\n```\n\nThen if you run the command again, you'll see the timing along with historical statistics:\n\n```shell\nsw sleep 1\n# Took 1.001665857s\n# Timing statistics for command [sleep 1]\n#                Total: 2\n#       Duration (min): 1.001665857s\n#       Duration (max): 1.002365579s\n#      Duration (mean): 1.002015718s\n#   Duration (std dev): 349.861µs\n```\n\n## Internals\n\n### Historical timings\n\nHistorical timings are grouped by command and arguments, and are recorded in a JSON file under the\nuser's local data directory:\n\n- For Linux, this is `$XDG_DATA_HOME/sw/history.json` or `$HOME/.local/share/sw/history.json`\n- For macOS, this is `$HOME/Library/Application Support/sw/history.json`\n- For Windows, this is `{FOLDERID_LocalAppData}\\sw\\history.json`\n\nThis history file is automatically created on first run, so if you want to reset the history, simply\ndelete the file!\n\n## Motivations\n\nI basically had two motivations in creating this software:\n\n1. I often rerun the same command multiple times to execute things like ETL jobs and other data\n   pipelines. `sw` can be used to track how long these runs take on average compared to the current\n   run, so that I can quickly identify when something is faster or slower than usual.\n2. I wanted an excuse to practice some more Rust :)\n\n## Contributing\n\nWhen contributing to this repository, please follow the steps below:\n\n1. Fork the repository\n2. Submit your patch in one commit, or a series of well-defined commits\n3. Submit your pull request and make sure you reference the issue you are addressing\n\n## License\n\nSee [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerluc%2Fsw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerluc%2Fsw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerluc%2Fsw/lists"}