La forma más antigua es la mejor: $start = microtime(true); // Execute the query $time = microtime(true) - $start;