monotonic-timer 1.0.0

A simple monotonic timer. Use it to schedule execution of closures after a delay.
Documentation
  • Coverage
  • 84.21%
    16 out of 19 items documented4 out of 18 items with examples
  • Size
  • Source code size: 47.61 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.37 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • ambaxter/monotonic_timer.rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ambaxter

Monotonic Timer

Simple implementation of a Monotonic Timer in and for Rust.

Example

extern crate monotonic_timer;
use std::sync::mpsc::channel;

let timer = monotonic_timer::Timer::new();
let (tx, rx) = channel();

let _guard = timer.schedule_with_delay(Duration::from_sec(3), move || {
  tx.send(()).unwrap();
});

rx.recv().unwrap();
println!("This code has been executed after 3 seconds");

Attribution

This project is a slightly modified version of https://github.com/Yoric/timer.rs.