Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
ISO Datetime - add microseconds - replace vs slice
ISO Datetime - add microseconds - replace vs slice
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5764.195 Safari/537.36
Browser:
Chrome 116
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
slice
4.5M/s
replace
3.6M/s
View exact numbers
Test name
Executions per second
✓
slice
4,461,801 Ops/sec
replace
3,552,518 Ops/sec
Script Preparation code:
var strIn = '2023-12-18T12:30:00Z'; var strOut = '';
Tests:
replace
strOut = strIn.replace('Z', '123Z');
slice
strOut = strIn.slice(0, -1) + '123Z';