|
|
|
File: C:/usr/local/lib/php/blueshoes-4.2/core/util/Bs_StopWatch.class.php
BlueShoes Application Framework - util
Bs_StopWatch
Bs_StopWatch
**********************************************************************
|
public class Bs_StopWatch
**********************************************************************
Stopwatch - class to measure time intervals in microseconds.... well... hey it's a stopwatch, what can I say more about it :-)You can take times during a code run and at the end get a time table asHTML or text table. The output will contain total and as delta betweeneach take in microseconds.NOTE: This class makes use of php's microtime(). from the manual:"This function is only available on operating systems that support thegettimeofday() system call."I know that linux and windows do that. Haven't seen anything about other os.--sb This class is no more an extension from Bs_Object because I need it in Bs_Objectand I don't want any conflicts. I think we can do this with a basic object like this one.
| Authors | |
| Version | 4.2.$id$ |
| Copyright | blueshoes.org, part of the php application framework |
|
| |
|
|
|
Private Method Summary |
| void |
_weightIt()Warning: documentation is missing. |
|
|
|
|
|
Public Method Details |
Bs_StopWatch |
|
public void Bs_StopWatch( )
|
| |
Constructor.
|
| Returns |
void |
|
reset |
|
public void reset( )
|
| |
Resets the stopwatch.
|
| Returns |
void |
|
takeTime |
|
public void takeTime( [ string $info ] )
|
| |
Takes a time and calculates the total time so far and the delta time
since the last take. These values are stored.
|
| Parameter |
|
| string |
$info |
= >>''<< |
|
Add any info as memo for what the time take stands for. |
|
| Returns |
void |
|
getTime |
|
public integer getTime( )
|
| |
Returns total time in ms since reset.
|
| Returns |
integer Total time in ms since reset. |
|
getDelta |
|
public integer getDelta( )
|
| |
Returns total time in ms since last call to getDelta()
|
| Returns |
integer Total time in ms since since last call. |
|
toHtml |
|
public string toHtml( [ string $title ] )
|
| |
Displays all stops so far as HTML table.
|
| Parameter |
|
| string |
$title |
= >>''<< |
|
a title to display |
|
| Returns |
string an html table |
|
toString |
|
public string toString( [ string $title ] )
|
| |
Displays all stops so far as simple string table.
|
| Parameter |
|
| string |
$title |
= >>''<< |
|
a title to display |
|
| Returns |
string table |
|
|
Private Method Details |
_weightIt |
|
private void _weightIt( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
|
|
|
Private Constant Details |
BS_STOPWATCH_VERSION
define( BS_STOPWATCH_VERSION, >>4.0.$x$<< )
Case: default: case sensitive
|
|
BS_STOPWATCH_SW_SEC
define( BS_STOPWATCH_SW_SEC, >>1<< )
Case: default: case sensitive
|
|
BS_STOPWATCH_SW_MSEC
define( BS_STOPWATCH_SW_MSEC, >>0<< )
Case: default: case sensitive
|
|
|
|
|
|
| PHPDoc 1.0beta |