{"id":23169198,"url":"https://github.com/abrarnitk/exec_time","last_synced_at":"2025-08-18T06:33:58.123Z","repository":{"id":57626633,"uuid":"226620106","full_name":"AbrarNitk/exec_time","owner":"AbrarNitk","description":"Time measuring for Rust functions","archived":false,"fork":false,"pushed_at":"2023-01-19T08:23:25.000Z","size":19,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-13T20:54:44.706Z","etag":null,"topics":["functionexecutiontime","measuretime","printexecutiontime","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AbrarNitk.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}},"created_at":"2019-12-08T05:35:54.000Z","updated_at":"2023-08-26T02:09:38.000Z","dependencies_parsed_at":"2023-01-27T21:16:23.479Z","dependency_job_id":null,"html_url":"https://github.com/AbrarNitk/exec_time","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbrarNitk%2Fexec_time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbrarNitk%2Fexec_time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbrarNitk%2Fexec_time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbrarNitk%2Fexec_time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbrarNitk","download_url":"https://codeload.github.com/AbrarNitk/exec_time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230210400,"owners_count":18190671,"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":["functionexecutiontime","measuretime","printexecutiontime","rust"],"created_at":"2024-12-18T03:15:59.755Z","updated_at":"2024-12-18T03:17:27.387Z","avatar_url":"https://github.com/AbrarNitk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Time Measure for Rust Functions\n### It will simply print execution time of a function\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Crates.io](https://img.shields.io/crates/v/exec_time)](https://crates.io/crates/exec_time)\n[![Build Status](https://travis-ci.org/AbrarNitk/exec_time.svg?branch=master)](https://travis-ci.org/AbrarNitk/exec_time)\n\n#### Usage\n```toml\n[dependencies]\nexec_time = \"0.1.4\"\n```\n\n## Examples\nIn print log, it is printing `Time \u003cprefix\u003e::\u003cfunction_name\u003e::\u003csuffix\u003e: \u003cexecution time\u003e mills`\n\n#### Example 1\nIt will always print.\n\n```rust\n#[macro_use]\nextern crate exec_time;\n\n#[exec_time]\nfn login() {\n    std::thread::sleep(std::time::Duration::from_millis(100));\n}\n\nfn main() {\n    login()\n}\n```  \n\n```text\nTime login: 102 mills\n```\n\n#### Example 2\nIt will print only in debug mode.\n\n```rust\n#[macro_use]\nextern crate exec_time;\n\n#[exec_time(print = \"debug\")]\nfn login() {\n    std::thread::sleep(std::time::Duration::from_millis(100));\n}\n\nfn main() {\n    login()\n}\n```  \n\n```text\nTime login: 102 mills\n```\n\n#### Example 3\nIt will never print.\n\n```rust\n#[macro_use]\nextern crate exec_time;\n\n#[exec_time(print = \"never\")]\nfn login() {\n    std::thread::sleep(std::time::Duration::from_millis(100));\n}\n\nfn main() {\n    login()\n}\n```  \n\n```text\n```\n\n#### Example 4\nIt will print, prefix and suffix with function name.\n\n```rust\n#[macro_use]\nextern crate exec_time;\n\n#[exec_time(print = \"always\", prefix = \"user/lib\", suffix=\"route\")]\nfn login() {\n    std::thread::sleep(std::time::Duration::from_millis(100));\n}\n\nfn main() {\n    login()\n}\n```  \n\n```text\nTime user/lib::login::route: 102 mills\n```\n\n\n### Note Point\nHere `print`, `prefix` and `suffix` all are optional field. Default value of print is `always`.\n`print` may be `always`(by default), `debug`, `never`. If the value is `always` it will print always.\nIf value is `debug`, It will print only in debug mode else, It will never print.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabrarnitk%2Fexec_time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabrarnitk%2Fexec_time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabrarnitk%2Fexec_time/lists"}