Skip to content

add a macro rule sleep! #12914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
electricface opened this issue Mar 15, 2014 · 1 comment
Closed

add a macro rule sleep! #12914

electricface opened this issue Mar 15, 2014 · 1 comment

Comments

@electricface
Copy link

macro_rules! sleep(
    ( $sec:expr ) => ( ::std::io::timer::sleep( (($sec)*1000. ) as u64 ))
)

example

fn main(){
    for i in range(0,10){
        sleep!(0.5);
        println!("sleep {}",i);
    }
}
@alexcrichton
Copy link
Member

Closing for reasons found here: #12915 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants