timestamp = Date.now(); vs timestamp = new Date().toISOString();Fastest: timestamp = Date.now(); (5.1x faster)
8,787,380 ops/sec
1,726,006 ops/sec
Fastest: timestamp = Date.now(); (4.8x faster)
16,075,407 ops/sec
3,347,357 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| timestamp = Date.now(); | |
| timestamp = new Date().toISOString(); |
| Test name | Executions per second |
|---|---|
| ✓ timestamp = Date.now(); | 22,355,450 Ops/sec |
| timestamp = new Date().toISOString(); | 11,484,954 Ops/sec |