Added benchmark helper

This commit is contained in:
Marcin Kurczewski 2013-11-01 10:08:43 +01:00
parent c3b2c68add
commit c4faa3bf85

View file

@ -0,0 +1,20 @@
<?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();