Recently I am looking at the loose coupling and customizable open-source framework of Baidu, tangram. js's eyes suddenly focused on a way to get the number of milliseconds: (+ newDate () In fact, there is nothing like converting the date to the number type using the operator, so I'm sure there is no native date writing method (newDate... syntaxHighlighter. all ();
Recently, I was looking at the loose coupling and customizable open-source framework of Baidu, tangram. js, which suddenly focused on a way to get the number of milliseconds:
(+ New Date ())
In fact, there is nothing about this writing method, that is, converting the Date type to the number type using the operator, so I am sure this writing method is not as efficient as the native writing of the Date (new Date (). getTime:
So we did the following test:
1
2
3
4
5Test on converting Date to millisecond
6
15
16
17
18