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
Supply.interval is drifting #5533
Comments
From @AlexDanielCode: Result: In this case it is about 1ms per second, which is probably very bad. Is there any reason for it to do so? |
From @zoffixznetOn Tue Aug 09 14:36:10 2016, alex.jakimenko@gmail.com wrote:
Are you sure it's not just an artifact of your measurement method? I'm not even sure what it's measuring. Compare these: perl6 -e 'for ^Inf { sleep .1; say (now - BEGIN now) % 1 }' Shows your "drift" that wobbles between 0.1 and 0.9 seconds. perl6 -e 'for ^Inf { sleep .1; say now - BEGIN now }' Shows all the values incrementing by .1 seconds, no drifts, as is proper. The occasional extra .01 seconds is expected, as we sleep for 'at least' .1 seconds and can't be super exact. |
The RT System itself - Status changed from 'new' to 'open' |
From @AlexDanielYou can do it without % 1, sure. It is there to make it easier to see the
Sure, but there is no 「sleep」 in Supply.interval(1) example (except for the My point is that Supply.interval() drifts. Yes, by a small amount of 1 ms I am not sure what TimToady meant here: On Fri, Aug 12, 2016 at 6:11 AM, Zoffix Znet via RT <
|
From @zoffixznetOn Thu Aug 11 21:14:41 2016, alex.jakimenko@gmail.com wrote:
I'm not familiar with the internals, but I'd suspect that drift in .interval() is for the same reasons there's drift in sleep(). It emits in intervals of at least X seconds, which I'd expect it to do, rather than to keep true to some arbitrary starting point, frequently emitting in smaller-than-X-seconds intervals just to compensate. |
Migrated from rt.perl.org#128878 (status was 'open')
Searchable as RT128878$
The text was updated successfully, but these errors were encountered: