- microtime: documentation ( source)
- number_format: documentation ( source)
- sprintf: documentation ( source)
<?php
$timestart = microtime( true );
$class = 'css';
$item = array( 'foo', 'bar', 'baz' );
for($i=0;$i<1000000;$i++){
$str = sprintf( "<a class='button button-secondary%s' href='themes.php?page=%s'$></a>", $class, $item[2], $item[0] );
}
$timeend = microtime( true );
$timetotal = $timeend - $timestart;
$r = number_format( $timetotal, 3 );
echo $r;