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
770090
public function getElapsedTime() : Duration
    {
        if ($this->startTime === null) {
            return $this->duration;
        }

        return $this->duration->plus(Duration::between($this->startTime, $this->clock->getTime()));
    }
945575
public function getSummary()
    {
        $this->stop();

        if ($this->start !== null) {
            $summary = $this->end - $this->start;
            $summary = round($summary, 2);

            return $summary;

        } else {
            throw new LogicException('Timer was not started');
        }
    }
744337
public double getMeanThp() {
    if (getCount() == 0) {
      return 0.0;
    } else {
      final double elapsed = getTick() - startTime;
      return getCount() / elapsed * TimeUnit.SECONDS.toNanos(1);
    }
  }
632968
def elapsed_ms(self):
        
        dt = datetime.datetime.now() - self.start_time
        return ((dt.days * 24 * 3600) + dt.seconds) * 1000  \
            + dt.microseconds / 1000.0
226970
public function getExecutionTimeProportion()
    {
        if ($this->getExecutionTime() && $this->getProcess()->getAvgExecutionTime()) {
            return round($this->getExecutionTime() / $this->getProcess()->getAvgExecutionTime(), 2);
        } elseif ($this->getExecutionTime()) {
            return $this->getExecutionTime();
        } elseif ($this->getProcess()->getAvgExecutionTime()) {
            return 0;
        } else {
            return 1;
        }
    }
383764
public function get_duration()
    {
        if (!$this->duration) {
            $duration = $this->get_technical_infos(media_subdef::TC_DATA_DURATION);
            $this->duration = $duration ? round($duration->getValue()) : false;
        }

        return $this->duration;
    }
602337
public long getElapsedMilliseconds() {
		long elapsed;
		if (running) {
			elapsed = (System.nanoTime() - startTime);
		} else {
			elapsed = (stopTime - startTime);
		}
		return elapsed / nsPerMs;
	}
529413
public function timeTaken()
    {
        $timeStop = microtime(true);
        $timeTaken = (float) substr(-($this->timeStarted - $timeStop), 0, 5);
        return $timeTaken;
    }
1301285
public long getElapsedSeconds() {
		long elapsed;
		if (running) {
			elapsed = (System.nanoTime() - startTime);
		} else {
			elapsed = (stopTime - startTime);
		}
		return elapsed / nsPerSs;
	}
176131
function () {
            if (this._duration) {
                return this._duration;
            }
            if (this._start && this._end) {
                return moment.duration(this._end - this._start);
            }
            else {
                return moment.duration(0);
            }
        }
1049332
def pause(self):
        
        if self._end_time is not None:
            # the stopwatch is already paused
            return
        self._end_time = datetime.datetime.now()
        self._elapsed_time += self._end_time - self._start_time
1084135
def get_total_time(self):
        
        first_step = self.steps[0]
        last_step = self.steps[-1]
        seconds = self.history[last_step]["__timestamp__"] \
                  - self.history[first_step]["__timestamp__"]
        return datetime.timedelta(seconds=seconds)
953086
public function getExecutionTime()
    {
        $seconds = $this->getTime() - $this->startTime;

        $seconds = round($seconds);
        if ($seconds < 60) {
            return $seconds . ' sec';
        }
        $minutes = round($seconds / 60);
        $seconds = $seconds % 60;

        return $minutes . ' min ' . $seconds . ' sec';
    }
116425
public function stop(): float
	{
		$last = end($this->laps);

		$last->stop();

		return $last->getStopTime() - $this->laps[0]->getStartTime();
	}
714742
public function getDuration()
    {
        $start = $this->getStarted();

        if (empty($start)) {
            return 0;
        }

        $end = $this->getFinished();

        if (empty($end)) {
            $end = new \DateTime();
        }

        return $end->getTimestamp() - $start->getTimestamp();
    }
482082
def get(self):
        
        now = datetime.now()
        if self._start_time:
            if self._stop_time:
                return (self._stop_time - self._start_time).total_seconds()
            return (now - self._start_time).total_seconds()
        return 0.
965467
public function getDuration()
    {
        if (!isset($this->data['events']['__section__'])) {
            return 0;
        }

        $lastEvent = $this->data['events']['__section__'];

        return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime();
    }