Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Adding native Date.now() support to now() #242
Extended the now() method with a conditional check if Date.now() is available and if so, use that (which is considerably faster):
Because it's a simple task, and there is a balance between added code & real world perf gain. I haven't seen a case where devs go, "Ya know what, that +new Date was the real bottleneck in our app". As a side note, jsPerf uses +new Date instead of forking for Date.now() because it didn't seem to affect the outcome of results.