Skip to content
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

Top level sleep-method #162

Merged
merged 3 commits into from
Feb 18, 2018
Merged

Conversation

Jens0512
Copy link
Member

@Jens0512 Jens0512 commented Feb 17, 2018

Did this a few weeks ago, dunno why i didn't make the pr before now.

Binds to crystal sleep

sleep(1) sleeps for 1 second
it also takes floats: sleep(0.01)

sleep() sleeps forever or until the program is interrupted

@faultyserver
Copy link
Member

Can the specs for this be moved into Myst? Recently all of the native library specs were ported over, so I'd like to see if we can keep it that way.

For testing, you should be able to use Time.now on either side of sleep, then assert that the difference between them is around the amount of time you expected.

@Jens0512
Copy link
Member Author

Yes of course

@faultyserver
Copy link
Member

LGTM! Thanks :)

@faultyserver faultyserver added this to the Next milestone Feb 18, 2018
@faultyserver faultyserver merged commit 8e97011 into myst-lang:master Feb 18, 2018
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

Successfully merging this pull request may close these issues.

2 participants