0

我正在使用 microtime 来获取脚本执行时间

$time_start = microtime(true);
....
....
//many process here, many result be printed here
$time_end = microtime(true);
$time = substr(($time_end - $time_start),0,5);
echo time;

是否可以$time在结果页的上方打印?我也尝试过使用css,也打印在上面,但是,$time仍然打印在resul页面的底部。

4

1 回答 1

0
//many process here, many result be printed here
$time_end = microtime(true);
$time = substr(($time_end - $time_start),0,5);
?>
<div class="time">
    <?php echo time; ?>
</div>

<style>
.time{
    position:absolute;
    top:0;
    right:0;
    z-index:9999;
}
</style>

您是否尝试过像这样将其回显到 dom 中?

于 2012-10-31T00:26:14.910 回答