Gumbo_Timer
Timer Class
Author(s): |
Michael Luster <mluster79@yahoo.com> |
License: | New BSD License |
Copyright: | Copyright (c) 2007, iBayou, Michael Luster |
Link: | http://sourceforge.net/projects/phpgumbo |
Version: | 0.0.1 |
Implements interfaces:
Class Variables
bool $_running = false [line 41]
bool $_stopped = true [line 43]
array $_times = array () [line 38]
Class Methods
public Gumbo_Timer __construct ( [bool $start] )
[line 51]
Constructor
Parameter(s):
- (bool) $start :: starts the Timer
[ Top ]
public num average ( [int $precision] )
[line 214]
Returns the average time between Laps
Parameter(s):
- (int) $precision :: rounds the number to the given precision
- precondition:
laps() >= 2 Implementation of:
[ Top ]public bool isRunning ( ) [line 278]Returns if the Timer is running (or has been started)
Implementation of:
[ Top ]isRunning() Implementation of:
[ Top ]isStopped() - postcondition:
!isRunning() Implementation of:
[ Top ]public num stamp ( [int $lap] ) [line 132]Returns the actual microtime value of the given lap (0 => start time)
Parameter(s):
- (int) $lap :: (0 returns start time, if > laps() or negative, returns stop time)
Implementation of:
[ Top ]public void start ( [bool $reset] ) [line 64]Starts the Timer by recording the current time stamp
Parameter(s):
- (bool) $reset :: resets timer
- precondition:
!isRunning() - postcondition:
isStarted() Implementation of:
[ Top ]isRunning() - postcondition:
isStopped() Implementation of:
[ Top ]public num time ( [int $lap], [int $precision] ) [line 166]Returns the time difference from the given lap to the previous lap
If the parameter is null or 0, it will return the total time from start to stop recorded by the Timer. If parameter greater than total laps, it will return the difference from the Stop time to the previous lap.
Parameter(s):
- (int) $lap :: lap number (if > laps(), returns last time)
- (int) $precision :: rounds the number to the given precision
- precondition:
laps() > 2 Implementation of:
[ Top ]