use the microtime() function its real eazy example :- function getmicrotime(){ list($msec, $sec) = explode(" ",microtime()); return ((float)$msec + (float)$sec); } $time_start = getmicrotime(); // Code goes here... $time_end = getmicrotime(); $time = sprintf('%.16f', $time_end - $time_start); echo 'parsed in ' . $time . ' seconds';