b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.8) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: Timer

Source Location: /blogs/inc/_misc/_timer.class.php

Class Timer

Property Summary
mixed   $_times   Remember times.

[ Top ]
Method Summary
Timer   Timer()   Constructor.
array   get_categories()   Get a list of used categories.
integer   get_count()   Get number of timer resumes (includes start).
float   get_current_microtime()   Get the current time in microseconds.
string   get_duration()   Get the duration for a given category.
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 48]

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 56]

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

Constructor.

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


[ Top ]
get_categories  [line 225]

  array get_categories( )

Get a list of used categories.



[ Top ]
get_count  [line 165]

  integer get_count( $category  )

Get number of timer resumes (includes start).

Parameters:
   $category: 


[ Top ]
get_current_microtime  [line 236]

  float get_current_microtime( )

Get the current time in microseconds.



[ Top ]
get_duration  [line 154]

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

Get the duration for a given category.

Parameters:
string   $category:  Category name
integer   $decimals:  Number of decimals after dot.


[ Top ]
get_microtime  [line 181]

  float get_microtime( $category  )

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

Parameters:
   $category: 


[ Top ]
get_state  [line 204]

  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 114]

  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 68]

  void reset( $category  )

Reset a timer category.

Parameters:
   $category: 


[ Top ]
resume  [line 131]

  void resume( $category  )

Resumes the timer on a category.

Parameters:
   $category: 


[ Top ]
start  [line 77]

  void start( $category, [ $log = true]  )

Start a timer.

Parameters:
   $category: 
   $log: 


[ Top ]
stop  [line 91]

  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, 18 Dec 2007 23:23:21 +0100 by phpDocumentor 1.4.0