[JavaScript] Performance comparison of Date.now vs new Date().getTime() vs +new Date

Tadashi Shigeoka ·  Tue, August 4, 2015

I checked the execution time of JavaScript’s Date.now vs new Date().getTime() vs +new Date with jsPerf.

JavaScript

The result was that Date.now was the fastest.

date-now-vs-new-date-gettime

So let’s use Date.now.

That’s all from the Gemba.