nim-schedules
nim-schedules copied to clipboard
Milliseconds support
import schedules, times, os
schedules:
every(milliseconds=20, id="tick", throttle=30):
echo("tick ", now())
sleep(5000)
Fails currently with [DivByZeroDefect]
My bad. Param seconds
is still required. Works fine.
import schedules, times, os
schedules:
every(seconds=0, milliseconds=5, id="tick", throttle=30):
echo("tick ", now())
sleep(5000)
Seems that it randomly compiles and randomly fails with DivByZeroDefect
@qb-0 Currently, nim-schedules uses Second as the minimal resolution (fromUnix). I guess we can update the library by using fromUnixFloat, which supports subsecond as resolution.
In my experience, the smallest possible interval is 2 seconds. Anything below that will still result in an interval of "every 2 seconds".