static public Timer::read($name)
Reads the current timer value without stopping the timer.
string $name: The name of the timer.
int The current timer value in ms.
static public function read($name) { if (isset(static::$timers[$name]['start'])) { $stop = microtime(TRUE); $diff = round(($stop - static::$timers[$name]['start']) * 1000, 2); if (isset(static::$timers[$name]['time'])) { $diff += static::$timers[$name]['time']; } return $diff; } return static::$timers[$name]['time']; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Timer.php/function/Timer::read/8.1.x