PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Joshua Townsend  >  Code Timer  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example of using class to see how long a function takes to execute
Class: Code Timer
Measure the time a PHP script takes to execute
Author: By
Last change:
Date: 15 years ago
Size: 433 bytes


Class file image Download
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(""); // 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.";

For more information send a message to info at phpclasses dot org.