0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

laravel mysql sql 速度計測

Posted at

速度を計測しちゃおう

phpやsqlで処理時間を計測したいときがある。
そんなときはサクッと!

hoge.php

$start = hrtime(true); // 計測開始時間

// ここに計測したい処理を書く
// 計測したい処理を書くここまで

$end = hrtime(true); // 計測終了時間
$nano_sec = $end - $start;
$sec = $nano_sec / 1000000000;
echo '処理時間:'. $sec .'秒' . '<br>';
die;

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?