mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
New function: ormStopWatch::GetElapsedTime to compute the cumulated elapsed time on a stop watch still running -not used yet (but tested!)
SVN:trunk[3420]
This commit is contained in:
@@ -82,6 +82,25 @@ class ormStopWatch
|
||||
return $this->iTimeSpent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the working elapsed time since the start of the stop watch
|
||||
* even if it is currently running
|
||||
* @param oAttDef AttributeDefinition Attribute hosting the stop watch
|
||||
*/
|
||||
public function GetElapsedTime($oAttDef)
|
||||
{
|
||||
if (is_null($this->iLastStart))
|
||||
{
|
||||
return $this->GetTimeSpent();
|
||||
}
|
||||
else
|
||||
{
|
||||
$iElapsed = $this->ComputeDuration($this, $oAttDef, $this->iLastStart, time());
|
||||
return $this->iTimeSpent + $iElapsed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function GetStartDate()
|
||||
{
|
||||
return $this->iStarted;
|
||||
|
||||
Reference in New Issue
Block a user