//в самом начале пишем$mtime = microtime();$mtime = explode(" ",$mtime);$mtime = $mtime[1] + $mtime[0];$tstart = $mtime; //в конце$mtime = microtime();$mtime = explode(" ",$mtime);$mtime = $mtime[1] + $mtime[0];$tend = $mtime;$totaltime = round(($tend - $tstart)*1000, 2);$mem = round(memory_get_usage() / 1024, 2);echo $mem.' кб/ '.$totaltime.' мс';