{"id":22064339,"url":"https://github.com/zimfw/duration-info","last_synced_at":"2026-04-27T21:31:37.235Z","repository":{"id":108622374,"uuid":"351657176","full_name":"zimfw/duration-info","owner":"zimfw","description":"Exposes to prompts how long the last command took to execute.","archived":false,"fork":false,"pushed_at":"2022-11-01T00:59:20.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-29T20:44:41.925Z","etag":null,"topics":["duration","zim","zimfw","zsh","zsh-plugin","zsh-plugins","zsh-prompt","zsh-theme"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/zimfw.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":"2021-03-26T04:02:20.000Z","updated_at":"2024-11-28T13:14:32.000Z","dependencies_parsed_at":"2023-03-25T20:32:39.035Z","dependency_job_id":null,"html_url":"https://github.com/zimfw/duration-info","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zimfw/duration-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fduration-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fduration-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fduration-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fduration-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimfw","download_url":"https://codeload.github.com/zimfw/duration-info/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fduration-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"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":["duration","zim","zimfw","zsh","zsh-plugin","zsh-plugins","zsh-prompt","zsh-theme"],"created_at":"2024-11-30T19:04:08.825Z","updated_at":"2026-04-27T21:31:37.220Z","avatar_url":"https://github.com/zimfw.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"duration-info\n=============\n\nExposes to prompts how long the last command took to execute.\n\nSettings\n--------\n\nBy default, the duration information will be only set if the command took at\nleast 2 seconds to execute. The threshold value, in seconds, can be customized\nwith:\n\n    zstyle ':zim:duration-info' threshold \u003cthreshold value\u003e\n\nThe threshold value can be a decimal number. If the threshold value is less than\n1, then milliseconds are automatically shown.\n\nMilliseconds can also be directly enabled with the following zstyle:\n\n    zstyle ':zim:duration-info' show-milliseconds yes\n\nTheming\n-------\n\nTo configure the format of the duration information, use the following syntax in\nyour prompt code:\n\n    zstyle ':zim:duration-info' format '\u003cstring containing %d\u003e'\n\nThe occurrence of the `%d` code in the format string is substituted by the\nduration, and the `duration_info` variable is set to the formatted string. If\nthe duration is less than the threshold, the variable is unset instead.\n\nIn your prompt code, add `${duration_info}` to where you want the duration\ninformation to be displayed. Usually, you'll add it to the value of either `PS1`\nor `RPS1`. Also, add the `duration-info-preexec` and `duration-info-precmd`\nfunctions to the preexec and precmd hooks respectively.\n\nHere's an example:\n```zsh\nsetopt nopromptbang prompt{cr,percent,sp,subst}\n\nzstyle ':zim:duration-info' threshold 0.5\nzstyle ':zim:duration-info' format '(%d) '\n\nautoload -Uz add-zsh-hook\nadd-zsh-hook preexec duration-info-preexec\nadd-zsh-hook precmd duration-info-precmd\n\nPS1='${duration_info}%# '\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimfw%2Fduration-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimfw%2Fduration-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimfw%2Fduration-info/lists"}