Trait nannou::time::DurationF64

source ·
pub trait DurationF64 {
    // Required method
    fn secs(&self) -> f64;

    // Provided methods
    fn ms(&self) -> f64 { ... }
    fn mins(&self) -> f64 { ... }
    fn hrs(&self) -> f64 { ... }
    fn days(&self) -> f64 { ... }
    fn weeks(&self) -> f64 { ... }
}
Expand description

An extension for the std::time::Duration type providing some simple methods for easy access to an f64 representation of seconds, ms, mins, hrs, and other units of time.

While these measurements make it easier to work with sketches and artworks, it’s worth noting that resolution may be lost, especially at high values.

Required Methods§

source

fn secs(&self) -> f64

A simple way of retrieving the duration in seconds.

Provided Methods§

source

fn ms(&self) -> f64

A simple way of retrieving the duration in milliseconds.

By default, this is implemented as self.secs() * 1_000.0.

source

fn mins(&self) -> f64

A simple way of retrieving the duration as minutes.

source

fn hrs(&self) -> f64

A simple way of retrieving the duration as hrs.

source

fn days(&self) -> f64

A simple way of retrieving the duration as days.

source

fn weeks(&self) -> f64

A simple way of retrieving the duration as weeks.

Implementations on Foreign Types§

source§

impl DurationF64 for Duration

source§

fn secs(&self) -> f64

Implementors§