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.
Code slow down on function call
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
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
}