setTimeout sometimes fires sooner than specified |
||||
Issue descriptionhttps://static-misc.glitch.me/set-timeout-delay This is a setTimeout 'loop' with a delay of 10ms. However, you pretty get a callback happening less than 10ms from when it was scheduled. Is this expected behaviour? This also happens in Edge & Firefox, but not Safari.
,
Jul 31
We suspect that it is indeed due to timer fuzzing. We'll check to make sure.
,
Jul 31
,
Aug 2
Did a quick test, and indeed disabling the time clamper[1][2] makes the problem go away. What's happening is the individual callbacks run at randomly jittered times, which may make the measured delay between two consecutive runs less than 10ms. I think we want to maintain this behavior for now for the reason mentioned. [1] https://cs.chromium.org/chromium/src/gin/v8_platform.cc?l=115&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fgin%252Fv8_platform.cc%253Froot%253Dchromium-android%2523M6CsQ058%25252Faxd0FtprCTRWsoiRmVbBRRivqcxwPq7uI4%25253D&gsn=TimeClamper&ct=xref_usages [2] https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/time_clamper.cc?q=timeclamper&sq=package:chromium&dr=CSs&l=15 |
||||
►
Sign in to add a comment |
||||
Comment 1 by t...@tws.name
, Jun 19 2018