

JavaScript ‘wake’ event - shawndumas
http://blog.alexmaccaw.com/javascript-wake-event

======
exDM69
If you do a timeout polling like this, it might be a good idea to bump up the
timout to several minutes (not every 20 seconds like in the example code).

Peridically waking up an idle CPU just to check the time has a surprisingly
big effect on power consumption. This might be a real issue if you have this
page open in your smartphone browser but the phone is idle but not sleeping in
your pocket.

~~~
edwinvdgraaf
RequestAnimationFrame[1] would solve that, however it wouldn't trigger in the
background, which may, or may not be wanted.

[1]: [http://www.paulirish.com/2011/requestanimationframe-for-
smar...](http://www.paulirish.com/2011/requestanimationframe-for-smart-
animating/)

~~~
masklinn
Probably is actually, I'd expect there's little need to update the list if
said list is not being looked at. On the other hand, it might be fairly costly
while the system is being watched as it will fire (and do some check) on every
single frame.

------
lucb1e
Been there done that. Never thought it was worth making a plugin for or even
blogging about it though.

~~~
caludio
... and that post to be in HN front page. Wow.

