public function check(?int $iterationNumber = null): self
    {
        if ($this->isStopped()) {
            throw new \RuntimeException('Timer[' . $this->name . '] is already stopped.');
        }
        if ($this->isNotStarted()) {
            $this->start();
        } else {
            $this->mark($iterationNumber);
        }
        return $this;
    }
public function check(?int $iterationNumber = null): self
    {
        if ($this->isStopped()) {
            throw new \RuntimeException('Timer[' . $this->name . '] is already stopped.');
        }
        if ($this->isNotStarted()) {
            $this->start();
        } else {
            $this->mark($iterationNumber);
        }
        return $this;
    }
public function check ( ? int $ iterationNumber = null ) : self { if ( $ this -> isStopped ( ) ) { throw new \ RuntimeException ( 'Timer[' . $ this -> name . '] is already stopped.' ) ; } if ( $ this -> isNotStarted ( ) ) { $ this -> start ( ) ; } else { $ this -> mark ( $ iterationNumber ) ; } return $ this ; }
Marks the time.
If timer was not started starts the timer.
@param int|null $iterationNumber
@return self
Marks the time . If timer was not started starts the timer .