- microtime: documentation ( source)
- explode: documentation ( source)
<?php
class Main
{
private $N;
public function run()
{
$this->N = 77777777;
$string = '';
for ( $i = $this->N; $i --> 0; )
{
$string .= ' ';
}
}
public function getTime()
{
$mtime = microtime();
$mtime = explode( ' ', $mtime );
$mtime = $mtime[1] + $mtime[0];
return $mtime;
}
}
$Main = new Main();
$start = $Main->getTime();
$Main->run();
$end = $Main->getTime();
echo "Method execution took " . ( $end - $start ) . " seconds";