also u r using wrong variable $fd in while loop while you have defined $fp,
so this becomes infinite loop.  this should give a warning message, if you
have not disabled display of same.  check your error logs.

$fp = fopen("d:\www\ex030124.log", "r");
$i = 0;
while (!feof($fp)) {
        $rowData = fgets($fd);
        /*
        if(substr($rowData, 1, 1) == "#") {
                $iisTitle = preg_split(":", $rowData, "1");
                echo $iisTitle . "<BR>";
        }
        */
        $i++;
        //echo $i . "<BR>";
}

regds,
-----Original Message-----
From: Matt Babineau [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 15, 2003 01:18
To: [EMAIL PROTECTED]
Subject: Interesting problem - PHP 4.3, IIS5, ISAPI


I am trying to output the page runtime to omake a comparison between php
and Coldfusion. I have 2 functions one to start a timer, one to end a
timer.

The php code block in the middle between reads a 140mb file and does
some other stuff. This is fairly unimportant at this point. With the
code block in between the timer functions present, the timer functions
don't output the processing time. When I remove the code block, the
timer functions work great...I don't get it!!

Help!

CODE:
--------------------------
<?
function startTiming() {
  global $startTime;
  $microtime = microtime();
  $microsecs = substr($microtime, 2, 8);
  $secs = substr($microtime, 11);
  $startTime = "$secs.$microsecs";
}
startTiming();
?>


<HTML>
<HEAD>
<TITLE>Stats Server</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>

<BODY>
<?

$fp = fopen("d:\www\ex030124.log", "r");
$i = 0;

while (!feof($fp)) {
        $rowData = fgets($fd);
        /*
        if(substr($rowData, 1, 1) == "#") {
                $iisTitle = preg_split(":", $rowData, "1");
                echo $iisTitle . "<BR>";
        }
        */
        $i++;
        //echo $i . "<BR>";
}

?>
</BODY>
</HTML>
<?
function stopTiming() {
  global $startTime;
  $microtime = microtime();
  $microsecs = substr($microtime, 2, 8);
  $secs = substr($microtime, 11);
  $endTime = "$secs.$microsecs";
  echo "<HR>Execution time " . ($endTime - $startTime) . " seconds.";
        }

stopTiming();
?>



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to