for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* User: alec
* Date: 30.11.18
* Time: 17:41
*/
namespace AlecRabbit\Tools\Traits;
use AlecRabbit\Traits\GettableName;
trait TimerFields
{
use GettableName;
/** @var float */
protected $previous;
protected $start;
protected $creation;
protected $elapsed;
/** @var bool */
protected $stopped = false;
protected $currentValue;
protected $avgValue;
protected $minValue;
/** @var int */
protected $minValueIteration = 0;
protected $maxValue;
protected $maxValueIteration = 0;
protected $count = 0;
* @return bool
public function isStopped(): bool
return $this->stopped;
}
public function isNotStopped(): bool
return !$this->stopped;
* @return float
public function getLastValue(): float
return $this->currentValue;
public function getAverageValue(): float
return $this->avgValue;
public function getMinValue(): float
return $this->minValue;
public function getMaxValue(): float
return $this->maxValue;
* @return int
public function getCount(): int
return $this->count;
public function getMinValueIteration(): int
return $this->minValueIteration;
public function getMaxValueIteration(): int
return $this->maxValueIteration;
public function getElapsed(): float
return $this->elapsed;
public function getCreation(): float
return $this->creation;
public function getPrevious(): float
return $this->previous;
public function getStart(): float
return $this->start;