| Crates.io | duration-breakdown |
| lib.rs | duration-breakdown |
| version | 0.2.0 |
| created_at | 2021-06-20 21:36:04.454058+00 |
| updated_at | 2021-07-30 23:08:54.882425+00 |
| description | Breakdowns of time durations into their constituent parts |
| homepage | |
| repository | https://github.com/thomascastleman/duration-breakdown.git |
| max_upload_size | |
| id | 412584 |
| size | 21,894 |
Breakdowns of durations of time into their constituent parts of various units.
use duration_breakdown::DurationBreakdown;
use std::time::Duration;
let breakdown = DurationBreakdown::from(Duration::new(12_345_678, 1234));
assert_eq!(
breakdown.to_string(),
"20 weeks, 2 days, 21 hours, 21 minutes, 18 seconds, and 1234 nanoseconds");