簡體   English   中英

回聲占用太多時間

[英]echo taking too much time

我想改善php腳本的頁面生成時間。 但是根據php profiler報告,它是echo語句,大約需要0.9秒。

我在“ CentOS版本5.6(最終版)”機器中使用“ php-5.3 ”。

這是php代碼-

<?php
    $AllTimerDataValue = ClMiscellaneous::getAllActivityData();//returns an array of size maximum 40
    $output = '<input type="hidden" name="actions" value="'.$_REQUEST['actions'].'">';
    $output.= '<table id="gradient-style-dup" class="activity_stream_container_tbl" rules="all" align="center">';
    $output.= ClMiscellaneous::getHtmlViewOfSingleActivity($AllTimerDataValue);//returns html code based on $AllTimerDataValue
    $output.= '</table>';
    echo $output; // This is taking around 0.9 sec
?>

對於配置文件,我使用的是firefox的“ DBG Bar”加載項,而在服務器端,我使用的是PHP的DBG模塊。

原因很可能是您在服務器上使用調試器,我敢肯定,回聲不會花費0.9秒。

但是,您可能想嘗試使用print()而不是echo();。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM