BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

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
Version4.2.$id$
Copyrightblueshoes.org, part of the php application framework

 

Public Method Summary

void

Bs_StopWatch()

Constructor.
void

reset()

Resets the stopwatch.
void

takeTime([ string $info ])

Takes a time and calculates the total time so far and the delta time
integer

getTime()

Returns total time in ms since reset.
integer

getDelta()

Returns total time in ms since last call to getDelta()
string

toHtml([ string $title ])

Displays all stops so far as HTML table.
string

toString([ string $title ])

Displays all stops so far as simple string table.

Private Method Summary

void

_weightIt()

Warning: documentation is missing.

Private Field Summary

string

$_startTime

string

$_stops

string

$_lastTakeTime

string

$_lastDeltaTime

Private Constant Summary

BS_STOPWATCH_VERSION >>4.0.$x$<< Warning: documentation is missing.
BS_STOPWATCH_SW_SEC >>1<< Warning: documentation is missing.
BS_STOPWATCH_SW_MSEC >>0<< 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 Field Details

$_startTime

private string $_startTime

>>NULL<<



$_stops

private string $_stops

>>NULL<<



$_lastTakeTime

private string $_lastTakeTime

>>NULL<<



$_lastDeltaTime

private string $_lastDeltaTime

>>NULL<<



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




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta