8 releases
Uses old Rust 2015
0.2.0 | Sep 11, 2017 |
---|---|
0.1.6 | Mar 11, 2016 |
#5 in #alarm
81,183 downloads per month
Used in 214 crates
(35 directly)
31KB
414 lines
Timer
Simple implementation of a Timer in and for Rust.
Example
extern crate timer;
extern crate chrono;
use std::sync::mpsc::channel;
let timer = timer::Timer::new();
let (tx, rx) = channel();
timer.schedule_with_delay(chrono::Duration::seconds(3), move || {
tx.send(()).unwrap();
});
rx.recv().unwrap();
println!("This code has been executed after 3 seconds");
lib.rs
:
A simple timer, used to enqueue operations meant to be executed at a given time or after a given delay.
Dependencies
~1MB
~18K SLoC