Merge pull request #7251 from zevv/issue-6270-sleepAsync-timer-resolution

Allow float argument to sleepAsync() to allow sub-millisecond resolution
This commit is contained in:
Dominik Picheta 2018-02-28 20:02:17 +00:00 • committed by GitHub
commit 99ae9269f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1513,7 +1513,7 @@ proc poll*(timeout = 500) =
# Common procedures between current and upcoming asyncdispatch
include includes.asynccommon
proc sleepAsync*(ms: int): Future[void] =
proc sleepAsync*(ms: int | float): Future[void] =
## Suspends the execution of the current async procedure for the next
## ``ms`` milliseconds.
var retFuture = newFuture[void]("sleepAsync")