{"id":21655204,"url":"https://github.com/pseitz/rust_measure_time","last_synced_at":"2025-06-26T23:10:09.536Z","repository":{"id":57637643,"uuid":"93164327","full_name":"PSeitz/rust_measure_time","owner":"PSeitz","description":"measures and prints wall time in rust for given scope","archived":false,"fork":false,"pushed_at":"2024-12-09T13:46:28.000Z","size":29,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T21:14:29.988Z","etag":null,"topics":["measure","rust","scope","time","wall"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/PSeitz.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":"2017-06-02T12:41:39.000Z","updated_at":"2025-03-02T14:40:25.000Z","dependencies_parsed_at":"2024-11-25T08:41:37.641Z","dependency_job_id":null,"html_url":"https://github.com/PSeitz/rust_measure_time","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":0.4864864864864865,"last_synced_commit":"fd678e377ab83be5ac7d4f423e0ab85470410b59"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Frust_measure_time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Frust_measure_time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Frust_measure_time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Frust_measure_time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PSeitz","download_url":"https://codeload.github.com/PSeitz/rust_measure_time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480427,"owners_count":21110937,"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":["measure","rust","scope","time","wall"],"created_at":"2024-11-25T08:30:38.544Z","updated_at":"2025-04-11T21:14:37.948Z","avatar_url":"https://github.com/PSeitz.png","language":"Rust","readme":"[![Docs](https://docs.rs/measure_time/badge.svg)](https://docs.rs/crate/measure_time/)\n[![Crates.io](https://img.shields.io/crates/v/measure_time.svg)](https://crates.io/crates/measure_time)\n\n\n# measure_time\n\nThe crate provides macros, which measure the time until end of scope and print the elapsed time in a human readable format.\n\nThis is done by creating an object, which measures the time. The time is printed when the object is dropped.\n\nThe logging behaviour is the same as other log macros like info!(..)\n\n### Installation\n\nSimply add a corresponding entry to your `Cargo.toml` dependency list:\n\n```toml,ignore\n[dependencies]\nmeasure_time = \"0.8\"\n```\n\n### Examples\n\n```rust\nuse measure_time::{info_time, debug_time, trace_time, error_time, print_time};\nfn main() {\n    info_time!(\"measure function\");\n    {\n        debug_time!(\"{:?}\", \"measuring block\");\n        let mut sum = 0;\n        for el in 0..50000 {\n            sum+=el;\n        }\n        println!(\"{:?}\", sum);\n    }\n    trace_time!(\"{:?}\", \"trace\");\n    print_time!(\"print\");\n    error_time!(target: \"measure_time\", \"custom target\");\n}\n```\n\n### Changelog\n\n#### Version 0.4\nObjects to measure time are only created when the log level is enabled, else ```None``` will be created\n\n#### Version 0.4.2\nAdd error and warn levels\n\n#### Version 0.5.0\nChange time formatting for improved readability\n\n#### Version 0.6.0\nBehaviour is now the same as other log macros (eg. info!). Reexporting log crate macros via pub use.\nPreviously all tracing was made to the measure_time target (e.g. RUST_LOG=measure_time=debug). This is now fixed.\nAdded a small example (https://github.com/PSeitz/rust_measure_time/tree/master/measure_time_example).\n\n#### Version 0.7.0\nSupport 2018 imports, with improved macro import hygiene.\n\n#### Version 0.8.0\nFix human readable time, see https://github.com/PSeitz/rust_measure_time/commit/bd829342aaed87db84f49ee6f7f46749b8c8e2ca for details.\n\n#### Version 0.8.1\nUse wasm-compatible Instant https://github.com/PSeitz/rust_measure_time/issues/3\n\n#### Version 0.9\nUse std::Instant\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseitz%2Frust_measure_time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpseitz%2Frust_measure_time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseitz%2Frust_measure_time/lists"}