Skip to content

Instantly share code, notes, and snippets.

@nurullahisik
Created March 1, 2019 08:18
Show Gist options
  • Save nurullahisik/172812e1022ca942fc7650be778a2bda to your computer and use it in GitHub Desktop.
Save nurullahisik/172812e1022ca942fc7650be778a2bda to your computer and use it in GitHub Desktop.
<?php
// capture the start time
$start_time = microtime(true);
// do some stuff
// ...
// display how long the script took
echo "execution took: ".
(microtime(true) - $start_time).
" seconds.";
/// ---------------------------------------------------
$start_time = microtime(true);
register_shutdown_function('my_shutdown');
// do some stuff
// ...
function my_shutdown() {
global $start_time;
echo "execution took: ".
(microtime(true) - $start_time).
" seconds.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment