Using node.js os.cpus() to detect user idle time?
问题 I'm developing a chat application with appjs that uses node.js as the platform. I'm stucked with detecting when computer is idle (when user is away from it or not using it). There is os module in node.js and its os.cpus() provides such information for each core: [ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 252020, nice: 0, sys: 30340, idle: 1070356870, irq: 0 } }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', speed: 2926, times: { user: 306960, nice: 0