PHP Classes
Icontem

File: timer.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrey Nikishaev  >  Little Timer  >  timer.php  
File: timer.php
Role: Class source
Content type: text/plain
Description: class
Class: Little Timer
Measure the time a script takes to execute
 

Contents

Class file image Download
<?php
class Timer {
    static 
$time=array();
    
public function set($n='0') {
        list(
$msec$sec) = explode(chr(32), microtime());
        
self::$time[$n]=$msec+$sec;
    }
    
public function get($n='0') {
        list(
$msec$sec) = explode(chr(32), microtime());
        
$now=$msec+$sec;
        return 
round($now-self::$time[$n], 12)."<br/>";
    }
}

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products