[Phpwm] timing a function

Chris Lovell stormys at gmail.com
Fri Oct 21 12:04:02 UTC 2011


$start = microtime(true);

/* your function stuff here */

$end = microtime(true);
$time = $time_end - $time_start;

echo "$time seconds";

http://php.net/manual/en/function.microtime.php

On 21 October 2011 13:01, alan dunn <alan at dunns.co.uk> wrote:

>  I want to measure the execution time for a function - it is to determine
> a price given quantity discounts, promotion prices etc.
>
> Can anyone give me tips on how to do that?
>
> More generally I have the options of running a php function - or creating a
> database function in plpgsql to do the same thing. Someone might have a view
> about their relative speeds?
>
> thanks, alan dunn
>
> _______________________________________________
> Phpwm mailing list
> Website : http://www.phpwm.org
> Twitter : http://www.twitter.com/phpwm
> Facebook: http://www.facebook.com/group.php?gid=2361609907
>
> Post to list: Phpwm at mailman.lug.org.uk
> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/phpwm/attachments/20111021/e21773af/attachment.htm>


More information about the Phpwm mailing list