Location: PHPKode > scripts > Code Timer > code-timer/example1.php
<?php
require "timer.class.php"; // Get the timer class

// Simplest way to use this class:

$timer = new timer(); // Create an object; automatically starts timer unless called as timer(false)
$contents = file_get_contents("http://www.example.com"); // Example of code that might take a while to execute
$time = $timer->stop(); // Stop the timer and get the execution time

echo "Contents retrieved in {$time} seconds.";
?>
Return current item: Code Timer