首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >回声花了太多时间

回声花了太多时间
EN

Stack Overflow用户
提问于 2011-06-24 10:51:03
回答 1查看 263关注 0票数 0

我想提高php脚本的页面生成时间。但是,根据php分析器报告,它是echo语句,花费了大约0.9秒。

我在一个“版本5.6 (最终)”机器上使用"CentOS php-5.3“。

下面是php代码--

代码语言:javascript
复制
<?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“插件,而在服务器端,我使用的是php的DBG模块。

EN

回答 1

Stack Overflow用户

发布于 2011-07-11 10:55:18

这可能是因为您在服务器上使用调试器,我可以肯定的是,echo不会花费0.9秒。

但是,您可能希望尝试print()而不是echo();

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6466756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档