AngryLawyer/rust-sdl2 — pull request #79 by andelf (2014-04-16 17:06:32+00:00)
Title: add Timer implementation

This fixes #11 .

There's no need to add userdata (*void) parameter because rust closure can use Send types automatically.

usage:

```rust
{
let mut tm = sdl2::timer::Timer::new(1000, || {
println!("hello worldi in timer!");
1000 // 0 means remove self
}, true); // if remove_on_drop
tm.start(); // must manually call start()
sdl2::timer::delay(2000);
} // auto remove here
```

```
let mut cnt = 0;
sdl2::timer::Timer::new(400, || {
println!("cnt => {}", cnt);
cnt += 1;
400
}, false).start();
```