szurubooru/src/Helpers/BenchmarkHelper.php

21 lines
292 B
PHP
Raw Normal View History

2013-11-01 10:08:43 +01:00
<?php
class BenchmarkHelper
{
protected static $lastTime;
public static function init()
{
self::$lastTime = microtime(true);
}
public static function tick()
{
$t = microtime(true);
$lt = self::$lastTime;
self::$lastTime = $t;
return $t - $lt;
}
}
BenchmarkHelper::init();