src/Stopwatch.php
public function getElapsedTime() : Duration
    {
        if ($this->startTime === null) {
            return $this->duration;
        }

        return $this->duration->plus(Duration::between($this->startTime, $this->clock->getTime()));
    }
public function getElapsedTime() : Duration
    {
        if ($this->startTime === null) {
            return $this->duration;
        }

        return $this->duration->plus(Duration::between($this->startTime, $this->clock->getTime()));
    }
public function getElapsedTime ( ) : Duration { if ( $ this -> startTime === null ) { return $ this -> duration ; } return $ this -> duration -> plus ( Duration :: between ( $ this -> startTime , $ this -> clock -> getTime ( ) ) ) ; }
Returns the total elapsed time.

This includes the times between previous start() and stop() calls if any,
as well as the time since the stopwatch was last started if it is running.

@return Duration
Returns the total elapsed time .