time.js 211 B

12345678910111213
  1. module.exports = {
  2. sleep(ms) {
  3. return new Promise(resolve => {
  4. setTimeout(() => resolve(), ms)
  5. })
  6. },
  7. SECOND: 1000,
  8. MINUTE: 1000 * 60,
  9. HOUR: 1000 * 60 * 60,
  10. DAY: 1000 * 60 * 60 * 24,
  11. }