ceylon / ceylon.language

DEPRECATED
Apache License 2.0
153 stars 57 forks source link

system.sleep() #596

Open gavinking opened 9 years ago

gavinking commented 9 years ago

I think we should have a sleep() function in the language module. This can be implemented in both JS and Java, right?

tombentley commented 9 years ago

It can't be system.sleep() because it's not making the system sleep. It would have to be process.sleep(). But even then it's semantics on JVM are to make the current thread sleep which isn't quite the same thing. So I'm wondering how you'd specify this.

And how would you implement this on JS?

gavinking commented 9 years ago

And how would you implement this on JS?

Ah, sorry, you're right, I was thinking of using setTimeout() but that doesn't quite work. It would have to be implemented using a loop. Hrm.