{"id":17586840,"url":"https://github.com/berrij/rcpptimer","last_synced_at":"2026-02-12T10:31:27.781Z","repository":{"id":113083207,"uuid":"431619723","full_name":"BerriJ/rcpptimer","owner":"BerriJ","description":"Rcpp Tic-Toc Timer with OpenMP Support","archived":false,"fork":false,"pushed_at":"2024-09-22T22:32:30.000Z","size":8011,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-06T01:39:27.935Z","etag":null,"topics":["benchmarking","cpp","r","rcpp"],"latest_commit_sha":null,"homepage":"http://rcpptimer.berrisch.biz/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"zdebruine/RcppClock","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BerriJ.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","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-11-24T20:29:04.000Z","updated_at":"2024-09-22T22:16:50.000Z","dependencies_parsed_at":"2024-02-29T17:31:00.707Z","dependency_job_id":"ab1229d5-534c-470a-92b5-1087cbb0be82","html_url":"https://github.com/BerriJ/rcpptimer","commit_stats":null,"previous_names":["berrij/rcpptimer"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerriJ%2Frcpptimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerriJ%2Frcpptimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerriJ%2Frcpptimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BerriJ%2Frcpptimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BerriJ","download_url":"https://codeload.github.com/BerriJ/rcpptimer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242538968,"owners_count":20145880,"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":["benchmarking","cpp","r","rcpp"],"created_at":"2024-10-22T03:06:31.390Z","updated_at":"2026-02-12T10:31:27.747Z","avatar_url":"https://github.com/BerriJ.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rcpptimer \u003ca href=\"https://rcpptimer.berrisch.biz\"\u003e\u003cimg src=\"man/figures/rcpptimer_hex.png\" align=\"right\" height=\"138\" style=\"float:right; height:138px;\"\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN/METACRAN Version](https://img.shields.io/cran/v/rcpptimer?\u0026style=for-the-badge)](https://cran.r-project.org/package=rcpptimer)\n[![R-hub](https://img.shields.io/github/actions/workflow/status/berrij/rcpptimer/R-hub-main.yaml?\u0026style=for-the-badge\u0026label=RCMD-Check)](https://github.com/BerriJ/rcpptimer/blob/dev/.github/workflows/R-hub-main.yaml)\n[![Codecov](https://img.shields.io/codecov/c/github/berrij/rcpptimer?style=for-the-badge)](https://app.codecov.io/gh/berrij/rcpptimer?branch=main)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\nThis R Package provides Rcpp bindings for [cpptimer](https://github.com/BerriJ/cpptimer), a simple tic-toc class for timing C++ code. It's not just simple, it's blazing fast! This sleek tic-toc timer class supports nested and overlapping timers and OpenMP parallelism. It boasts a nanosecond-level time resolution. Results (with summary statistics) are automatically passed back to R as a `data.frame.`\n\n## Install\n\nInstall rcpptimer from CRAN.\n\n```\ninstall.packages(\"rcpptimer\")\n```\n\n## Basic Usage with Rcpp::cppFunction\n\nHere is a straightforward example of using the `Rcpp::Timer` with Rcpp::cppFunction:\n\n```r\nRcpp::cppFunction(\"\ndouble demo_rnorm()\n{\n  Rcpp::Timer timer;\n  timer.tic();\n  double x = rnorm(1, 1)[0];\n  timer.toc();\n  return(x);\n}\",\n  depends = \"rcpptimer\"\n)\n\ndemo_rnorm()\n```\n\nThe timer object will automatically write its result to the R environment:\n\n```r\nprint(times)\n       Microseconds SD   Min   Max Count\ntictoc        3.972  0 3.972 3.972     1\n```\n\nCheck out the [Documentation](https://rcpptimer.berrisch.biz/articles/rcpptimer.html) for:\n\n- Setting up multiple, nested, and overlapping timers\n- Using OpenMP parallelism\n- Using rcpptimer with `Rcpp::sourceCpp`\n- Adding rcpptimer to your package\n\n## Limitations\n\nProcesses taking less than a nanosecond cannot be timed.\n\nUnmatched `.tic()` and `.toc()` calls do not raise errors at compile time. However, they throw warnings at runtime.\n\n## Acknowledgments\n\nThis package (and the underlying [cpptimer](https://github.com/BerriJ/cpptimer) class) was inspired by [zdebruine](https://github.com/zdebruine)'s [RcppClock](https://github.com/zdebruine/RcppClock). I used that package a lot and wanted to add OpenMP support, alter the process of calculating summary statistics, and apply a series of other adjustments. I hope you find it useful.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberrij%2Frcpptimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberrij%2Frcpptimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberrij%2Frcpptimer/lists"}