<?php
class VPerformance {
    private static $start_time;
    private static $queries = 0;
    
    public static function start() {
        self::$start_time = microtime(true);
    }
    
    public static function end() {
        $end_time = microtime(true);
        $execution_time = ($end_time - self::$start_time) * 1000;
        
        if (isset($_GET['debug'])) {
            echo "<div style=\"position:fixed;bottom:0;right:0;background:#000;color:#fff;padding:10px;z-index:9999;\">
                Execution: {$execution_time}ms | Queries: " . self::$queries . "
            </div>";
        }
    }
    
    public static function logQuery() {
        self::$queries++;
    }
}

// Auto-start performance monitoring
VPerformance::start();
register_shutdown_function(['VPerformance', 'end']);
?>