0

マイクロタイムを使用してスクリプトの実行時間を取得しています

$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 に答える