[][src]Trait nannou::time::DurationF64

pub trait DurationF64 {
    fn secs(&self) -> f64;

    fn ms(&self) -> f64 { ... }
fn mins(&self) -> f64 { ... }
fn hrs(&self) -> f64 { ... }
fn days(&self) -> f64 { ... }
fn weeks(&self) -> f64 { ... } }

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

fn secs(&self) -> f64

A simple way of retrieving the duration in seconds.

Loading content...

Provided methods

fn ms(&self) -> f64

A simple way of retrieving the duration in milliseconds.

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

fn mins(&self) -> f64

A simple way of retrieving the duration as minutes.

fn hrs(&self) -> f64

A simple way of retrieving the duration as hrs.

fn days(&self) -> f64

A simple way of retrieving the duration as days.

fn weeks(&self) -> f64

A simple way of retrieving the duration as weeks.

Loading content...

Implementations on Foreign Types

impl DurationF64 for Duration[src]

Loading content...

Implementors

Loading content...