Differences between revisions 1 and 2
Revision 1 as of 2004-09-09 23:26:45
Size: 289
Editor: 61
Comment:
Revision 2 as of 2004-09-09 23:38:36
Size: 843
Editor: 61
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
'''
<?
/*
得到一个页面的执行时间,并显示出来。
get_microtime()函数可以保存在公共函数文件中供各个页面调用。
*/
function get_microtime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
?>
<?
//include('include/function.php');


$time_start = get_microtime();
echo "hello 1";
?>
<?
for($i=0;$i<100000;$i++)
{
 echo "$i aa";
}

?>

<?
echo "hello 2<br>";
$time_end = get_microtime();
$time = $time_end - $time_start;
echo $time;
?>
seconds.
"""

Describe 初步开发分析(一) here. 1、在线用户统计,存在一个用户同时打开2个窗口来浏览该文章,所以要记录 下来该用户两条数据,但是统计在线人数的时候,不管他打开几个浏览器窗口 都只能计算一个在线人数。 <?

$time_start = get_microtime(); echo "hello 1"; ?> <? for($i=0;$i<100000;$i++) {

  • echo "$i aa";

}

?>

<? echo "hello 2<br>"; $time_end = get_microtime(); $time = $time_end - $time_start; echo $time; ?> seconds. """

初步开发分析(一) (last edited 2009-12-25 07:16:14 by localhost)