Skip to content

setTimeout bug. There is example #8354

Description

@alsotang
  • Version:4.2.1, 5.9.0, 6.0.0
  • Platform: macos
  • Subsystem:
varstartTime=+newDate()while((newDate-startTime)<1000){}setTimeout(function(){varstartTime=+newDate()while((newDate-startTime)<3000){}vart1=newDatesetTimeout(function(){console.log(newDate-t1,'new Date - t1')// !!!!!!!!!!diff is 3000+, should be 20+},20)},20)

timediff should be 20+ms, but it would equal to the while block time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions