Skip to content

Instantly share code, notes, and snippets.

@mbrubeck
Last active December 10, 2015 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrubeck/4368362 to your computer and use it in GitHub Desktop.
Save mbrubeck/4368362 to your computer and use it in GitHub Desktop.
The infamous Sleep Sort algorithm, implemented in Rust.
extern mod std;
use std::timer::sleep;
use std::uv::global_loop;
fn main() {
for os::args().tail().each |&arg| {
do task::spawn {
let n = uint::from_str(arg).get();
sleep(global_loop::get(), n);
io::println(arg);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment