Closed
Description
- Version: v6.1.0 and master
- Platform: Windows 10 64-bit
- Subsystem: timers
Testcase:
console.log(Date());
setTimeout(function() {
console.log(Date());
}, 20000);
When running it normally, the result is as expected:
Sat May 14 2016 23:20:36 GMT+0300 (FLE Daylight Time)
Sat May 14 2016 23:20:56 GMT+0300 (FLE Daylight Time)
However, if you do the following:
- Start the script.
- Put the computer to sleep ASAP.
- Resume after 10 seconds.
The timeout fires not after the remaining 10 seconds, but after ~20 seconds:
Sat May 14 2016 23:22:14 GMT+0300 (FLE Daylight Time)
Sat May 14 2016 23:22:45 GMT+0300 (FLE Daylight Time)
I've asked on IRC and people say that this doesn't happen on Linux. That is, the callback is not delayed unless it would have occurred during sleep, in which case it's fired as soon as the computer wakes up.