Struct babalcore::TimeTracker[][src]

pub struct TimeTracker { /* fields omitted */ }

Implementations

impl TimeTracker[src]

pub fn new() -> TimeTracker[src]

Create a time tracker.

Examples

use babalcore::*;

let _tt = TimeTracker::new();

pub fn add(&mut self, delta: f64)[src]

Add time to the time tracker. This is typically something you'd call each time there's a process(delta).

Examples

use babalcore::*;

let mut tt = TimeTracker::new();
tt.add(0.01);
assert_eq!(0.01, tt.now_sec());

pub fn now_sec(&self) -> f64[src]

Get the number of seconds since start of time.

Examples

use babalcore::*;

let mut tt = TimeTracker::new();
assert_eq!(0.0, tt.now_sec());
tt.add(0.003);
assert_eq!(0.003, tt.now_sec());

pub fn now_msec(&self) -> i64[src]

Get the number of milliseconds since start of time.

Examples

use babalcore::*;

let mut tt = TimeTracker::new();
assert_eq!(0, tt.now_msec());
tt.add(0.003);
assert_eq!(3, tt.now_msec());

Trait Implementations

impl Clone for TimeTracker[src]

impl Copy for TimeTracker[src]

impl Debug for TimeTracker[src]

impl Default for TimeTracker[src]

impl Display for TimeTracker[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,