{"id":19203049,"url":"https://github.com/torkleyy/floating-duration","last_synced_at":"2025-05-12T13:25:55.539Z","repository":{"id":57630456,"uuid":"88370353","full_name":"torkleyy/floating-duration","owner":"torkleyy","description":"Rust duration conversion and formatting","archived":false,"fork":false,"pushed_at":"2018-06-17T18:26:35.000Z","size":552,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T13:06:52.299Z","etag":null,"topics":["library","rust","time"],"latest_commit_sha":null,"homepage":null,"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/torkleyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-15T19:42:20.000Z","updated_at":"2022-12-27T15:23:29.000Z","dependencies_parsed_at":"2022-09-26T22:30:21.152Z","dependency_job_id":null,"html_url":"https://github.com/torkleyy/floating-duration","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/torkleyy%2Ffloating-duration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torkleyy%2Ffloating-duration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torkleyy%2Ffloating-duration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torkleyy%2Ffloating-duration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torkleyy","download_url":"https://codeload.github.com/torkleyy/floating-duration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253746415,"owners_count":21957550,"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":["library","rust","time"],"created_at":"2024-11-09T12:46:36.945Z","updated_at":"2025-05-12T13:25:55.517Z","avatar_url":"https://github.com/torkleyy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# floating-duration\n\n[![Build Status][bi]][bl] [![Crates.io][ci]][cl] ![MIT/Apache][li] [![Docs.rs][di]][dl]\n\n[bi]: https://travis-ci.org/torkleyy/floating-duration.svg?branch=master\n[bl]: https://travis-ci.org/torkleyy/floating-duration\n\n[ci]: https://img.shields.io/crates/v/floating-duration.svg\n[cl]: https://crates.io/crates/floating-duration/\n\n[li]: https://img.shields.io/badge/license-MIT%2FApache-blue.svg\n\n[di]: https://docs.rs/floating-duration/badge.svg\n[dl]: https://docs.rs/floating-duration/\n\nAllows converting a `Duration` to floating-point seconds, milliseconds and microseconds. \nAdditionally, it allows automatic formatting of a `Duration` (it automatically chooses\na unit).\n\n## Usage\n\nMinimum Rust version: `1.8.0`\n\nAdd this crate to `Cargo.toml`\n\n```toml\n[dependencies]\nfloating-duration = \"0.1.2\"\n```\n\nNow you can easily print a `Duration`:\n\n```rust\nextern crate floating_duration;\n\nuse std::time::Instant;\n\nuse floating_duration::{TimeAsFloat, TimeFormat};\n\nfn main() {\n    let start = Instant::now();\n    \n    let result = (1..12).fold(1, |acc, x| acc * x);\n    \n    println!(\"Needed {}\", TimeFormat(start.elapsed()));\n    println!(\"In seconds: {}\", start.elapsed().as_fractional_secs());\n}\n```\n\n## Contribution\n\nContribution is very welcome!\n\nAny contribution you submit is assumed to be\ndual-licensed under MIT/Apache-2.\n\n## License\n\nfloating-duration is distributed under the terms of both the MIT license \nand the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorkleyy%2Ffloating-duration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorkleyy%2Ffloating-duration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorkleyy%2Ffloating-duration/lists"}