Page 1 of 1

Code slow down on function call

Posted: Sat Jul 24, 2004 1:18 pm
by Bubastis
I'm using php 4.3.8. I have a big class called template which has a function pparse which takes one argument.

In my code, I do a timestamp (using microtime), then I execute $template->pparse('body'). The first line of the pparse function then is another timestamp. Often 4 seconds or more pass between these timestamps. Any suggestion why? I'm running the php on a debian Linux system with apache; this is part of a web page.

Thanks.

Posted: Sat Jul 24, 2004 5:34 pm
by kettle_drum
You sure your suing microtime correctly??

Code: Select all

$mtime = explode(" ",microtime());
$start = $mtime[1] + $mtime[0];

myfunction('page', $start); //call function

function myfunction($word, $start){
   $mtime = explode(" ",microtime());
   $endtime = $mtime[1] + $mtime[0];
   $timetaken = $endtime-$start;
   echo $timetaken;
   
   //rest of function

}