clock.js 323 B

12345678910111213
  1. var getMilliseconds = function() {
  2. if (typeof process !== 'undefined' && process.hrtime) {
  3. var hrtime = process.hrtime();
  4. var seconds = hrtime[0];
  5. var nanoseconds = hrtime[1];
  6. return seconds * 1e3 + Math.floor(nanoseconds / 1e6);
  7. }
  8. return new Date().getTime();
  9. }
  10. module.exports = getMilliseconds;