/** * Returns the time when the application started, as a UNIX timestamp * with microseconds. * @return float */ public static function getStartTime() { if (!isset(self::$startTime)) { self::$startTime = microtime(true); } return self::$startTime; }
/** * Returns the time when the application started, in seconds * elapsed since 01.01.1970 plus microseconds if available. * @return float */ public static function getStartTime() { if (!isset(self::$startTime)) { if (function_exists('microtime')) { // microtime as float self::$startTime = microtime(true); } else { self::$startTime = floatval(time()); } } return self::$startTime; }