Skip to content

Instantly share code, notes, and snippets.

@MaikKlein
Created June 2, 2013 03:03
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 MaikKlein/5692462 to your computer and use it in GitHub Desktop.
Save MaikKlein/5692462 to your computer and use it in GitHub Desktop.
extern mod extra;
struct Timer;
impl Timer {
fn sleep(time: float){
let start_time = extra::time::precise_time_s();
let wait = time;
while start_time > (extra::time::precise_time_s() - wait) {}
}
}
fn main() {
for int::range(0,4) |i| {
do spawn {
for 2.times {
Timer::sleep(2f);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment