b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: Timer

Source Location: /blogs/b2evocore/_timer.class.php

Class Timer

Class Overview

This is a simple class to allow timing/profiling of code portions.

Located in /blogs/b2evocore/_timer.class.php [line 46]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
mixed   $_times   Remember times.

[ Top ]
Method Summary
Timer   Timer()   Constructor.
void   display_time()  
float   get_current_microtime()   Get the current time in microseconds.
string   get_duration()  
float   get_microtime()   Get the time in microseconds that was spent in the given category.
string   get_state()   Get the state a category timer is in.
boolean   pause()   Pauses a timer category. It may me resumed later on, see resume().
void   reset()   Reset a timer category.
void   resume()   Resumes the timer on a category.
void   start()   Start a timer.
boolean   stop()   Stops a timer category. It may me resumed later on, see resume(). This is an alias for pause().

[ Top ]
Properties
mixed   $_times = array() [line 55]

Remember times.

We store for each category (primary key) the state, start/resume time and the total passed time.

API Tags:
Access:  protected


[ Top ]
Methods
Constructor Timer  [line 63]

  Timer Timer( [string|NULL $category = NULL]  )

Constructor.

Parameters:
string|NULL   $category:  If a category is given the timer starts right away.


[ Top ]
display_time  [line 145]

  void display_time( $category, [ $decimals = 3]  )

Parameters:
   $category: 
   $decimals: 


[ Top ]
get_current_microtime  [line 211]

  float get_current_microtime( )

Get the current time in microseconds.



[ Top ]
get_duration  [line 156]

  string get_duration( $category, [ $decimals = 3]  )

Parameters:
   $category: 
   $decimals: 


[ Top ]
get_microtime  [line 167]

  float get_microtime( $category  )

Get the time in microseconds that was spent in the given category.

Parameters:
   $category: 


[ Top ]
get_state  [line 190]

  string get_state( $category  )

Get the state a category timer is in.

Parameters:
   $category: 

API Tags:
Return:  'unknown', 'not initialised', 'running', 'paused'


[ Top ]
pause  [line 110]

  boolean pause( $category  )

Pauses a timer category. It may me resumed later on, see resume().

NOTE: The timer needs to be started, either through the Constructor or the start() method.

Parameters:
   $category: 

API Tags:
Return:  false, if the timer had not been started.


[ Top ]
reset  [line 75]

  void reset( $category  )

Reset a timer category.

Parameters:
   $category: 


[ Top ]
resume  [line 128]

  void resume( $category  )

Resumes the timer on a category.

Parameters:
   $category: 


[ Top ]
start  [line 84]

  void start( $category  )

Start a timer.

Parameters:
   $category: 


[ Top ]
stop  [line 97]

  boolean stop( $category  )

Stops a timer category. It may me resumed later on, see resume(). This is an alias for pause().

Parameters:
   $category: 

API Tags:
Return:  false, if the timer had not been started.


[ Top ]

Documentation generated on Tue, 20 May 2008 01:55:51 +0200 by phpDocumentor 1.4.2