Your IP : 216.73.216.95


Current Path : /var/www/alh/system/library/journal3/utils/
Upload File :
Current File : /var/www/alh/system/library/journal3/utils/profiler.php

<?php

namespace Journal3\Utils;

class Profiler {

	private static $keys = array();

	public static function start($key) {
		if (static::isJournalKey($key)) {
			static::$keys[$key] = Arr::get(static::$keys, $key, 0) - round(microtime(true) * 1000);
		}
	}

	public static function end($key) {
		if (static::isJournalKey($key)) {
			static::$keys[$key] = Arr::get(static::$keys, $key, 0) + round(microtime(true) * 1000);
		}
	}

	public static function getStats() {
		return static::$keys;
	}

	private static function isJournalKey($key) {
		return strpos($key, 'journal3') !== false;
	}

}