Closed ghost closed 8 years ago
Is timestamp = (+new Date / 1000) | 0
intended to be the same as timestamp = ~~(+new Date / 1000)
which is intended to be the same as Math.floor(+new Date / 1000)
? If yes, then it is worth pointing out the benefits of each one so that one can decide the tradeoffs.
I've no cons about neither of the options, just the sintaxe verbosity... In terms of performance, Date.now() looks faster than new Date in my tests.
Leaving as it is right now. If you have a suggestion, please make a PR with addendum to the tip.
Maybe an easier and faster way?
Does anyone know if this would have any problems?