Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
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
Test name
Executions per second
replace
3552517.5 Ops/sec
slice
4461801.0 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';