{"id":16568316,"url":"https://github.com/xu-cheng/howlong","last_synced_at":"2026-03-14T06:32:39.399Z","repository":{"id":53132596,"uuid":"225890127","full_name":"xu-cheng/howlong","owner":"xu-cheng","description":":watch: Measure how long it takes for a program to execute in different clocks","archived":false,"fork":false,"pushed_at":"2021-11-01T05:18:38.000Z","size":71,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T21:09:10.671Z","etag":null,"topics":["profiling-library","rust","timer-clock"],"latest_commit_sha":null,"homepage":"https://docs.rs/howlong","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xu-cheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["xu-cheng"]}},"created_at":"2019-12-04T14:47:19.000Z","updated_at":"2022-01-17T07:50:36.000Z","dependencies_parsed_at":"2022-09-09T09:30:59.637Z","dependency_job_id":null,"html_url":"https://github.com/xu-cheng/howlong","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xu-cheng%2Fhowlong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xu-cheng%2Fhowlong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xu-cheng%2Fhowlong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xu-cheng%2Fhowlong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xu-cheng","download_url":"https://codeload.github.com/xu-cheng/howlong/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221815028,"owners_count":16885097,"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":["profiling-library","rust","timer-clock"],"created_at":"2024-10-11T21:09:04.072Z","updated_at":"2026-03-14T06:32:39.330Z","avatar_url":"https://github.com/xu-cheng.png","language":"Rust","funding_links":["https://github.com/sponsors/xu-cheng"],"categories":[],"sub_categories":[],"readme":"# howlong\n\n[![Build Status](https://github.com/xu-cheng/howlong/workflows/build/badge.svg)](https://github.com/xu-cheng/howlong/actions)\n[![Latest Version](https://img.shields.io/crates/v/howlong.svg)](https://crates.io/crates/howlong)\n[![Rust Documentation](https://docs.rs/howlong/badge.svg)](https://docs.rs/howlong)\n\nThis crate allows you to measure how long it takes for a program to execute in different clocks. It ports the functions of the [`boost-chrono`](https://boost.org/libs/chrono) and [`boost-timer`](https://boost.org/libs/timer) libraries.\n\nThe following clocks and their corresponding timers are implemented.\n\n* `SystemClock`, `SystemTimer`\n* `SteadyClock`, `SteadyTimer` if supported by the system.\n* `HighResolutionClock`, `HighResolutionTimer`\n* `ProcessRealCPUClock`, `ProcessRealCPUTimer`\n* `ProcessUserCPUClock`, `ProcessUserCPUTimer`\n* `ProcessSystemCPUClock`, `ProcessSystemCPUTimer`\n* `ProcessCPUClock`, `ProcessCPUTimer`\n* `ThreadClock`, `ThreadTimer`\n\n## Documentation\n\n\u003chttps://docs.rs/howlong\u003e\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nhowlong = \"0.1\"\n```\n\n## Examples\n\n```rust\nlet timer = howlong::HighResolutionTimer::new();\n// do some computations\nprintln!(\"{:?} have passed.\", timer.elapsed());\n\nlet timer = howlong::ProcessCPUTimer::new();\n// do other computations\nprintln!(\"{}\", timer.elapsed()); // 5.71s wall, 5.70s user + 0ns system = 5.70s CPU (99.8%)\n```\n\n## License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version 2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\u003cbr\u003e\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxu-cheng%2Fhowlong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxu-cheng%2Fhowlong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxu-cheng%2Fhowlong/lists"}