Clock-accurate timeout for Node.js and browser