Skip to content

Rust extensions for `std::time::Duration` to provide a more concise way to define durations

Notifications You must be signed in to change notification settings

defic/duration_helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

Rust extensions for `std::time::Duration` to provide a more concise way to define durations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages