- microtime: documentation ( source)
- preg_match: documentation ( source)
- number_format: documentation ( source)
<?php
$time = microtime(true);
for ($i = 0; $i < 10000; $i++) {
preg_match('/^label-(.+)/', $key, $matches);
}
$time = microtime(true) - $time;
echo 'preg_match() took ' . number_format($time, 3) . ' seconds' . "\n";