Skip to content

Instantly share code, notes, and snippets.

@branneman
Created May 2, 2011 16:00
Show Gist options
  • Save branneman/951833 to your computer and use it in GitHub Desktop.
Save branneman/951833 to your computer and use it in GitHub Desktop.
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