Skip to content

Timers are unreliable (firing too fast) when Dev Tools are open #22620

@dzek69

Description

@dzek69

Environment

  React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (8) ia32 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
      Memory: 2.97 GB / 15.89 GB
    Binaries:
      Node: 11.2.0 - C:\nodejs\node.EXE
      Yarn: 1.12.3 - C:\Apps\Yarn\bin\yarn.CMD
      npm: 6.4.1 - C:\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.2.0.0 AI-181.5540.7.32.5056338

Description

The same thing as here: #14639
Timers (both intervals and timeouts) are firing too fast, looks like they're dividing the time value by some factor.

Reproducible Demo

const start = Date.now();
console.log("start")
const fn = () => {
    console.log("end", Date.now() - start);
}

Simple setTimeout(fn, 5000) usually calls the function in around 1 second, but can be even faster.
Closing Dev Tools solves the issue.

#14639 seems to be wrongly closed by bot or there is an regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDebuggingIssues related to React Native DevTools or legacy JavaScript/Hermes debuggingIssue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.JavaScriptStaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions