now.js 476 B

123456789101112131415161718192021
  1. /**
  2. * Gets the timestamp of the number of milliseconds that have elapsed since
  3. * the Unix epoch (1 January 1970 00:00:00 UTC).
  4. *
  5. * @static
  6. * @memberOf _
  7. * @since 2.4.0
  8. * @category Date
  9. * @returns {number} Returns the timestamp.
  10. * @example
  11. *
  12. * _.defer(function(stamp) {
  13. * console.log(_.now() - stamp);
  14. * }, _.now());
  15. * // => Logs the number of milliseconds it took for the deferred invocation.
  16. */
  17. function now() {
  18. return Date.now();
  19. }
  20. module.exports = now;