duration_helper

Crates.ioduration_helper
lib.rsduration_helper
version0.1.0
sourcesrc
created_at2023-08-14 08:37:38.049421
updated_at2023-08-14 08:37:38.049421
descriptionSimple std::time::Duration extension methods for i64 and f64 types: 5.hours()
homepage
repository
max_upload_size
id943959
size6,349
Jeremias (defic)

documentation

README

Duration Extensions

A tiny Rust utility to provide a more concise way to define std::time::Duration

Usage

use duration_helper::DurationHelper;

let half_a_second = 0.5.secs();
let five_hours = 5.hours();
let day_and_a_half = 1.5.days();

Features

  • Extensions for:
    • Nanoseconds: nanos()

    • Microseconds: micros()

    • Milliseconds: millis()

    • Seconds: secs()

    • Hours: hours()

    • Days: days()

    • Weeks: weeks()

    • Months (approximated as 30 days): months()

    • Years (approximated as 365 days): years()

Commit count: 0

cargo fmt