{"id":14066763,"url":"https://github.com/poissonconsulting/hmstimer","last_synced_at":"2025-07-31T02:05:48.598Z","repository":{"id":39662560,"uuid":"186044769","full_name":"poissonconsulting/hmstimer","owner":"poissonconsulting","description":"An R package to track elapsed clock time using a `hms::hms()` scalar. ","archived":false,"fork":false,"pushed_at":"2025-06-03T22:35:58.000Z","size":3128,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-04T06:10:18.234Z","etag":null,"topics":["cran","hms","r","rstats","timer"],"latest_commit_sha":null,"homepage":"https://poissonconsulting.github.io/hmstimer/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poissonconsulting.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-10T19:38:48.000Z","updated_at":"2025-06-03T21:54:36.000Z","dependencies_parsed_at":"2024-08-13T07:11:40.338Z","dependency_job_id":"7858fd3a-4ec1-47b9-892a-1aad4cc8fd6f","html_url":"https://github.com/poissonconsulting/hmstimer","commit_stats":{"total_commits":213,"total_committers":8,"mean_commits":26.625,"dds":"0.17840375586854462","last_synced_commit":"4ba8308e02835cb4a41f23b341df503e457b9591"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/poissonconsulting/hmstimer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fhmstimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fhmstimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fhmstimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fhmstimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poissonconsulting","download_url":"https://codeload.github.com/poissonconsulting/hmstimer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poissonconsulting%2Fhmstimer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259813010,"owners_count":22915199,"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":["cran","hms","r","rstats","timer"],"created_at":"2024-08-13T07:05:14.932Z","updated_at":"2025-06-14T12:07:41.378Z","avatar_url":"https://github.com/poissonconsulting.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# hmstimer \u003cimg src=\"man/figures/logo.png\" align=\"right\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![R-CMD-check](https://github.com/poissonconsulting/hmstimer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/poissonconsulting/hmstimer/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/poissonconsulting/hmstimer/graph/badge.svg)](https://app.codecov.io/gh/poissonconsulting/hmstimer)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/license/mit/)\n[![CRAN status](https://www.r-pkg.org/badges/version/hmstimer)](https://cran.r-project.org/package=hmstimer)\n![CRAN downloads](https://cranlogs.r-pkg.org/badges/hmstimer)\n\u003c!-- badges: end --\u003e\n\n`hmstimer` is an R package to \ntrack elapsed clock time using a [hms::hms](https://github.com/tidyverse/hms) scalar.\n\n`hmstimer` was originally developed to time Bayesian model runs. It should not be used to estimate how long extremely fast code takes to execute as the package code adds a small time cost.\n\nCreate and start a timer with `tmr_timer(start = TRUE)`.\n\n```{r}\nlibrary(hmstimer)\n\ntmr \u003c- tmr_timer(start = TRUE)\nSys.sleep(0.1)\nstr(tmr)\nhms::as_hms(tmr)\n```\n\nGet the elapsed time with `tmr_elapsed()`.\nThe title is optional.\n```{r}\ntmr \u003c- tmr_timer(start = TRUE, title = \"my timer\")\n\nSys.sleep(0.1)\ntmr_elapsed(tmr)\n\nSys.sleep(0.1)\ntmr_elapsed(tmr)\n```\n\nStop the timer with `tmr_stop()`.\n\n```{r}\ntmr \u003c- tmr_stop(tmr)\ntmr_elapsed(tmr)\n\nSys.sleep(1)\ntmr_elapsed(tmr)\n```\n\nRestart the timer with `tmr_start()`.\n```{r}\ntmr \u003c- tmr_start(tmr)\ntmr_elapsed(tmr)\nSys.sleep(0.1)\ntmr_elapsed(tmr)\n```\n\nThere are several options for printing and formatting including coercing to a hms object.\n```{r}\ntmr \u003c- tmr_stop(tmr)\nprint(tmr)\ntmr_print(tmr)\ntmr_format(tmr, digits = 5)\n```\n\nIf running `tmr_print()` behaves differently.\n\n```{r}\ntmr \u003c- tmr_start(tmr)\ntmr_print(tmr)\n```\n\nThe time for a block of code to complete can be printed using `with_timer()`.\n\n```{r}\nwith_timer({\n  Sys.sleep(0.1)\n  Sys.sleep(0.1)\n  1 + 1\n})\n```\n\n## Installation\n\n### Release\n\nTo install the release version from [CRAN](https://CRAN.R-project.org/package=hmstimer).\n```r\ninstall.packages(\"hmstimer\")\n```\n\nThe website for the release version is at \u003chttps://poissonconsulting.github.io/hmstimer/\u003e.\n\n### Development\n\nTo install the development version from [GitHub](https://github.com/poissonconsulting/hmstimer)\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"poissonconsulting/hmstimer\")\n```\n\nor from [r-universe](https://poissonconsulting.r-universe.dev/hmstimer).\n```r\ninstall.packages(\"hmstimer\", repos = c(\"https://poissonconsulting.r-universe.dev\", \"https://cloud.r-project.org\"))\n```\n\n## Contribution\n\nPlease report any [issues](https://github.com/poissonconsulting/hmstimer/issues).\n\n[Pull requests](https://github.com/poissonconsulting/hmstimer/pulls) are always welcome.\n\n## Code of Conduct\n\nPlease note that the hmstimer project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoissonconsulting%2Fhmstimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoissonconsulting%2Fhmstimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoissonconsulting%2Fhmstimer/lists"}