Jump to content

Php Execution Time Script


Recommended Posts

does anyone know how to put in that code that tells how much time it took to make the page? i searched on google and lets say that a script about time isn't what i want.

thanks

Link to comment
Share on other sites


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';

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...