const string = '34956bbb22644e8ab7112755254fb44d';
function split2(string) {
return string.substring(0, 8) + '-' +
string.substring(8, 4) + '-' +
string.substring(12, 4) + '-' +
string.substring(16, 4) + '-' +
string.substring(20);
}
function benchmark(max, func, string) {
console.time('benchmark');
i = 0;
do {
i++;
func(string);
} while (i < max);
console.timeEnd('benchmark');
}
benchmark(10e6, split2, string);
<?php
$config = json_encode(file_get_contents('.env.json'), true);