now.js 520 B

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