blueshoes php application framework and cms            javascript_core
[ class tree: javascript_core ] [ index: javascript_core ] [ all elements ]

Class: Bs_StopWatch

Source Location: /core/util/Bs_StopWatch.class.js.php

Class Overview


Stopwatch


Author(s):

Version:

  • 4.0.$id$

Copyright:

  • blueshoes.org

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]
Stopwatch

... 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 in ms.

Sample: function stopWatch_Test() { sw = new Bs_StopWatch(); sw.takeTime('test1'); for (var i=0; i<1000000; i++) {} sw.takeTime('test2'); for (var i=0; i<100000; i++) {} sw.takeTime('test3'); sw.draw("Just a test"); }




Tags:

access:  public
version:  4.0.$id$
copyright:  blueshoes.org
author:  Sam Blum <at blueshoes dot org>


[ Top ]


Class Variables

$lastDeltaTime =  null

[line 145]


Type:   mixed


[ Top ]

$lastTakeTime =  null

[line 144]


Type:   mixed


[ Top ]

$reset =

[line 148]


Type:   mixed


[ Top ]

$startTime =  null

[line 142]


Type:   mixed


[ Top ]

$stopCnt =  0

[line 141]


Type:   mixed


[ Top ]

$stops =  null

[line 143]


Type:   mixed


[ Top ]



Class Methods


method draw [line 117]

void draw( mixed title, string $title)

Draw it dynamically into the current HTML NOTE: Your HTML *MUST* have a <body></body> tag.



Parameters:

string   $title   a title to display

[ Top ]

method getDelta [line 66]

integer getDelta( )

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



Tags:

return:  Total time in ms since since last call.


[ Top ]

method getTime [line 57]

integer getTime( )

Returns total time in ms since reset.



Tags:

return:  Total time in ms since reset.


[ Top ]

method reset [line 32]

void reset( )

Resets the stopwatch.



[ Top ]

method takeTime [line 43]

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.



Parameters:

string   info   'info' Add any info as memo for what the time take stands for.

[ Top ]

method toHtml [line 78]

string toHtml( mixed title, string $title)

Displays all stops so far as HTML table.



Tags:

return:  an html table


Parameters:

string   $title   a title to display

[ Top ]

method _weightIt [line 129]

void _weightIt( )

helper



[ Top ]


Documentation generated on Mon, 29 Dec 2003 22:18:33 +0100 by phpDocumentor 1.2.3