How to find my code execution time?
I am using the below snippet.
I am not happy with that?
list ($msec, $sec) = explode(\' \', microtime());
$mi
I'm using following class to determine time elapsed:
class StopWatch {
private static $total;
public static function start() {
self::$total = microtime(true);
}
public static function elapsed() {
return microtime(true) - self::$total;
}
}
You just have to call StopWatch::start
at the beginning and StopWatch::elapsed
whenever you want to know how much time elapsed from the start.