{"id":35285116,"url":"https://github.com/wcota/tictoc-fortran","last_synced_at":"2026-03-17T22:36:52.074Z","repository":{"id":109651857,"uuid":"153009244","full_name":"wcota/tictoc-fortran","owner":"wcota","description":"TicToc routine - Fortran","archived":false,"fork":false,"pushed_at":"2024-11-26T05:02:14.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-26T05:28:10.763Z","etag":null,"topics":["fortran","fortran-package-manager","fpm","timer"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wcota.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-10-14T19:11:13.000Z","updated_at":"2024-11-26T05:02:17.000Z","dependencies_parsed_at":"2024-11-26T05:25:02.530Z","dependency_job_id":"2e04ab64-4619-4f15-a0df-15f7ff1f2065","html_url":"https://github.com/wcota/tictoc-fortran","commit_stats":null,"previous_names":["wcota/tictoc-fortran"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wcota/tictoc-fortran","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcota%2Ftictoc-fortran","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcota%2Ftictoc-fortran/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcota%2Ftictoc-fortran/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcota%2Ftictoc-fortran/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wcota","download_url":"https://codeload.github.com/wcota/tictoc-fortran/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcota%2Ftictoc-fortran/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: 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":["fortran","fortran-package-manager","fpm","timer"],"created_at":"2025-12-30T15:17:11.992Z","updated_at":"2026-03-17T22:36:52.067Z","avatar_url":"https://github.com/wcota.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tictoc-fortran\n\nTicToc routine - Fortran\n\n## Usage\n\nCopy the file `src/tictoc_mod.f90` or add the package as a dependence using the [Fortran Package Manager](https://fpm.fortran-lang.org/) (Fpm):\n\n```toml\n[dependencies]\ntictoc-fortran.git = \"https://github.com/wcota/tictoc-fortran\"\n```\n\nImport the module using `use tictoc_mod`. This package provides the `tictoc_t` object. Create one using\n\n```fortran\ntype(tictoc_t)    :: ctimer\n```\n\nReset the timer:\n\n```fortran\ncall ctimer%reset()\n```\n\nUse the `tic` to start the clock, and `toc` to pause it: \n\n```fortran\ncall ctimer%tic()\n! do something\ncall ctimer%toc()\n\n! do anything else\n\ncall ctimer%tic()\n! do something\ncall ctimer%toc()\n```\n\nTo see how much time was spent doing something, use the `real` variable `t_tot`:\n\n```fortran\nwrite(*,*) ctimer%t_tot\n```\n\nA possible usage would be to stop the simulation after `x` samples if the program is taking too long:\n\n```fortran\ncall ctimer%reset()\ncall ctimer%tic()\nsampling: do sample=1,1000\n    if (ctimer%now() \u003e 5.0_dp * 60.0_dp) exit sampling\n    ! dynamics\nenddo sampling\n```\n\n## Example\n\nAn example is available at `example/example.f90`. To run it with Fpm, use `fpm run --example`. Expected output:\n\n```txt\nProject is up to date\nCPU TIME = \n0.35635800000000001\nNow measuring inside the loop...\nCPU TIME = \n0.57127699999999348\n```\n\nTested with `gfortran`, `ifort` and `ifx` compilers.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwcota%2Ftictoc-fortran","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwcota%2Ftictoc-fortran","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwcota%2Ftictoc-fortran/lists"}