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

sleepAsync sleeps for too long #4120

Closed
yglukhov opened this issue Apr 27, 2016 · 1 comment
Closed

sleepAsync sleeps for too long #4120

yglukhov opened this issue Apr 27, 2016 · 1 comment
Labels
Async Everything related to Nim's async

Comments

@yglukhov
Copy link
Member

Tested on macos:

import asyncdispatch
import times

proc main() {.async.} =
    echo "1: ", epochTime()
    await sleepAsync(1) # wait for 1 ms. Actual result (see below): ~500 ms
    echo "2: ", epochTime()
    await sleepAsync(1) # wait for 1 ms.  Actual result (see below): ~500 ms
    echo "3: ", epochTime()

asyncCheck main()

runForever()
nim c -r ~/test.nim
1: 1461774804.308667
2: 1461774804.81404
3: 1461774805.315593
@dom96 dom96 added the Async Everything related to Nim's async label Apr 27, 2016
@ghost
Copy link

ghost commented Apr 27, 2016

That's because the default polling timeout is set to 500 ms, right? is it an unintended consequence?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Async Everything related to Nim's async
Projects
None yet
Development

No branches or pull requests

2 participants