Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use Date.now() instead of (new Date()).getTime()

Date.now() is shown to be faster than (new Date()).getTime()

http://jsperf.com/date-now-vs-new-date-gettime
  • Loading branch information...
commit e9a9dea9eb88332dafadf51fee9f4a5a4f810a42 1 parent 0e1c0d6
Justin Plock authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  main.js
2  main.js
@@ -854,7 +854,7 @@ Request.prototype.oauth = function (_oauth) {
854 854 for (var i in form) oa[i] = form[i]
855 855 for (var i in _oauth) oa['oauth_'+i] = _oauth[i]
856 856 if (!oa.oauth_version) oa.oauth_version = '1.0'
857   - if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( (new Date()).getTime() / 1000 ).toString()
  857 + if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString()
858 858 if (!oa.oauth_nonce) oa.oauth_nonce = uuid().replace(/-/g, '')
859 859
860 860 oa.oauth_signature_method = 'HMAC-SHA1'

0 comments on commit e9a9dea

Please sign in to comment.
Something went wrong with that request. Please try again.