phpDocumentor profiler
[ class tree: profiler ] [ index: profiler ] [ all elements ]

Class: Timer

Source Location: /myphp-1.9/myphp-1.9-profiler/html/component/Timer.php

Class Timer

Class Overview

Used as a Profiler to track down bottle necks

Note: This class will use a global profiler name to hold one instance of a profiler object

  1. Usage:
  2. $timer = new Timer($name);
  3. $timer->start($name);
  4. print $timer->get($name);
  5. $timer->reset($name);
  6. Or
  7. Timer::display($name); // as text
  8. Timer::dump($name);

Located in /myphp-1.9/myphp-1.9-profiler/html/component/Timer.php [line 46]

Object
   |
   --Timer
Author(s):
Information Tags:
Todo:  simulate bcsub(), if not installed on your system

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Object

Object::$cachefile
Object::$html
Object::$sql

Inherited From Object

Object::Object()
Constructor
Object::addHtml()
Add the current html to the SourceCode object
Object::getCacheFileName()
Returns the name of the cache file name
Object::getClassName()
Returns the name of the instanciated class
Object::getHtml()
Returns the html for the element
Object::getMsg()
Get the formatted message and debug level and Log to file ?
Object::save()
Save the SQL cache file
Object::setCacheFileName()
Set the path/name of the cache file
Object::toString()
Returns the information for this class
Object::write()
Write the content to the file opened by fp

[ Top ]
Property Summary
array   $timerStart  
array   $timerStop  

[ Top ]
Method Summary
Timer   Timer()   Constructor
String   bcsub()   Simulates thec php-bcsub(), in case it is not installed on your system
void   display()   Display html
void   dump()   Dump html
String   get()   Get the time from started for the named timer
String   getHtml()   Builds the html for a timer stamp
String   getTime()   Get the current time, format and return it
void   init()   Init profiler
void   reset()   Reset the named timer
String   start()   Start the named timer
String   stop()   Stop the named timer

[ Top ]
Properties
array   $timerStart = array() [line 50]

[ Top ]
array   $timerStop = array() [line 55]

[ Top ]
Methods
Constructor Timer  [line 61]

  Timer Timer( [String $name = '']  )

Constructor

Parameters:
String   $name:  The name of the timer


[ Top ]
bcsub  [line 163]

  String bcsub( String $left, String $right, String $scale  )

Simulates thec php-bcsub(), in case it is not installed on your system

Parameters:
String   $left:  The left parameter
String   $right:  The right parameter
String   $scale:  The number of digits

API Tags:
Return:  The result like php-bcsub($left,$right,$scale)


[ Top ]
display  [line 204]

  void display( [String $name = ''], [String $text = '']  )

Display html

  1. Usage:
  2. Timer::display($name,$text);

Parameters:
String   $name:  The name of the timer
String   $text:  The plain text or as hidden html comments

API Tags:
Static:  


[ Top ]
dump  [line 124]

  void dump( [String $text = '']  )

Dump html

  1. Usage:
  2. Timer::dump($text);

Parameters:
String   $text:  The plain text or as hidden html comments

API Tags:
Static:  


[ Top ]
get  [line 172]

  String get( [String $name = '']  )

Get the time from started for the named timer

Parameters:
String   $name:  The name of the timer

API Tags:
Return:  The elapsed time formatted as '<sec><msec>'


[ Top ]
getHtml  [line 183]

  String getHtml( [String $name = ''], [String $text = '']  )

Builds the html for a timer stamp

Parameters:
String   $name:  The name of the timer
String   $text:  The plain text or as hidden html comments

API Tags:
Return:  The result as html


Redefinition of:
Object::getHtml()
Returns the html for the element

[ Top ]
getTime  [line 146]

  String getTime( [String $name = '']  )

Get the current time, format and return it

Parameters:
String   $name:  The name of the timer

API Tags:
Return:  The time formatted as <sec><msec>


[ Top ]
init  [line 107]

  void init( [String $name = '']  )

Init profiler

  1. Usage:
  2. Timer::init($name);

Parameters:
String   $name:  The name of the timer

API Tags:
Static:  


[ Top ]
reset  [line 91]

  void reset( [String $name = '']  )

Reset the named timer

Parameters:
String   $name:  The name of the timer


[ Top ]
start  [line 70]

  String start( [String $name = '']  )

Start the named timer

Parameters:
String   $name:  The name of the timer

API Tags:
Return:  The time formatted as <sec><msec>


[ Top ]
stop  [line 81]

  String stop( [String $name = '']  )

Stop the named timer

Parameters:
String   $name:  The name of the timer

API Tags:
Return:  The time formatted as <sec><msec>


[ Top ]

Documentation generated on Thu, 22 Dec 2005 17:20:47 +0100 by phpDocumentor 1.3.0RC3