specs_time

Crates.iospecs_time
lib.rsspecs_time
version0.6.1
sourcesrc
created_at2017-10-13 19:41:48.919201
updated_at2019-07-06 13:54:05.504875
descriptiontime resource for specs
homepagehttps://gitlab.com/nathanfaucett/rs-specs_time
repositoryhttps://gitlab.com/nathanfaucett/rs-specs_time.git
max_upload_size
id35534
size26,140
Nathan Faucett (nathanfaucett)

documentation

README

specs_time

time resource for specs

extern crate specs;
extern crate specs_bundler;
extern crate specs_time;

use specs::{DispatcherBuilder, World};
use specs_bundler::Bundler;
use specs_time::{Time, TimeBundle};
use std::{thread, time};

fn main() {
    let mut world = World::empty();

    let mut dispatcher = Bundler::new(&mut world, DispatcherBuilder::new())
        .bundle(TimeBundle::<f64>::default())
        .unwrap()
        .build();

    for _ in 0..60 {
        dispatcher.dispatch(&world);
        thread::sleep(time::Duration::from_millis(16));
    }

    let time = world.fetch::<Time<f64>>();
    println!("{:?}", *time);
}
Commit count: 27

cargo fmt