Instantly share code, notes, and snippets.

Embed
What would you like to do?
Timing script execution at high-precision
<?php
$time1 = explode(' ', microtime());
$time1 = $time1[1] . substr($time1[0], 1, -2);
// your code
$time2 = explode(' ', microtime());
$time2 = $time2[1] . substr($time2[0], 1, -2);
var_dump(bcsub($time2, $time1, 6));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment