TZBenchMark.php 466 Bytes
<?php

namespace Tz\WordPress\Tools;

class TZBenchMark {

    protected static $start_micro = 0;
    protected static $end_micro = 0;

    static function startTimer() {
        self::$start_micro = microtime(true);
    }

    static function endTimer() {
        self::$end_micro = microtime(true);
    }

    static function logTimer($prepend = "TZBENCHMARK TIME ====== ") {
        error_log($prepend.(self::$end_micro - self::$start_micro)." seconds");
    }

}