Hi to all
I'm using
echo date('H:i:s')." this step time\n";
in order to know how much time needs for each function in order to be executed.
How can I know the time with microseconds also?
Hi to all
I'm using
echo date('H:i:s')." this step time\n";
in order to know how much time needs for each function in order to be executed.
How can I know the time with microseconds also?
u Microseconds (added in PHP 5.2.2)
Take a look at http://no.php.net/manual/en/function.date.php for more information.
Just to add, there's PHP's microtime() function, which can be used like this:
$time_start = microtime(true);
//do stuff here
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "It took $time seconds\n";
Others have already sufficiently answered this question, but since this is a fairly basic question, I just want to mention the PHP.net documentation as an online reference for basic PHP info. It is quite thorough and covers all PHP functions, core constructs, and other language topics.
If you're using Firefox, the Mycroft Project has a wide variety of PHP.net search engine plugins. I would suggest using one of the function list searches, as it will automatically pull up the documentation for a particular function (if it is spelled correctly) or otherwise give a list of functions with similar spelling to choose from.
I'm putting this as an answer so anyone else searching for this question in the future will also see this and hopefully take my suggestion.