Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Mac OS X 10.15.7
Desktop
2 years ago
JavaScript Date Time format
2.0M/s
JavaScript Date Time format using Template Strings.
1.9M/s
Date().toLocaleString()
13K/s
Intl.DateTimeFormat()
12K/s
View exact numbers
| Test name |
Executions per second |
|
✓
JavaScript Date Time format
|
2,033,501 Ops/sec |
|
JavaScript Date Time format using Template Strings.
|
1,859,097 Ops/sec |
|
new Date()
|
882,096 Ops/sec |
|
Date().toLocaleString()
|
13,462 Ops/sec |
|
Intl.DateTimeFormat()
|
11,609 Ops/sec |
Tests:
-
new Date()
-
Intl.DateTimeFormat()
-
Date().toLocaleString()
-
JavaScript Date Time format
-
JavaScript Date Time format using Template Strings.