HEX
Server: Apache
System: Linux hz.vslconceptsdomains.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: dkfounda (3233)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/local/mailchannels/lib/TimeProfiler.php
<?php
class TimeProfiler {
    public static $times = array();
    public static $counts = array();

    public static function profileTime($label, $func) {
        $time_pre = microtime(true);

        $func();

        $time = microtime(true) - $time_pre;


        if (array_key_exists($label, self::$times)) {
            self::$times[$label] += $time;
            self::$counts[$label]++;
        } else {
            self::$times[$label] = $time;
            self::$counts[$label] = 1;
        }

        return $time;
    }

    public static function echoTimes() {
        foreach (self::$times as $label=>$time) {
            $counted = self::$counts[$label];
            echo "TIME_PROFILE for $label: total time: $time; times counted: $counted\n";
        }
    }
}