snooze-rs 0.0.2

An experimental library for sleeping periodically
docs.rs failed to build snooze-rs-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: snooze-rs-0.0.3

snooze-rs

Experimental library for sleeping periodically in Rust code.

Build Status

Usage:

Cargo.toml:

[dependencies.snooze-rs]
git = "https://github.com/Gekkio/snooze-rs.git"

Crate root:

extern crate snooze;

Basic usage:

use snooze::Snooze;

let mut snooze = try!(Snooze::new(Duration::milliseconds(42)));
loop {
  try!(snooze.wait());
  do_things();
}

The function do_things() will be called approximately every 42 ms, depending on system timer accuracy and assuming do_things() takes less than 42 ms.