Gets the duration of the events (including all periods).

@return int|float The duration (in milliseconds)
499773
public function getDuration()
    {
        $periods = $this->periods;
        $stopped = \count($periods);
        $left = \count($this->started) - $stopped;

        for ($i = 0; $i < $left; ++$i) {
            $index = $stopped + $i;
            $periods[] = new StopwatchPeriod($this->started[$index], $this->getNow(), $this->morePrecision);
        }

        $total = 0;
        foreach ($periods as $period) {
            $total += $period->getDuration();
        }

        return $total;
    }
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;
    }
1319238
public function getDuration() : ?string 
    {
        if ( ! $this->hasDuration()) {
            $this->setDuration($this->getDefaultDuration());
        }
        return $this->duration;
    }
997565
protected static function get_duration_text($seconds) {
        if (empty($seconds)) {
            return get_string('none');
        }
        $data = self::parse_seconds($seconds);
        switch ($data['u']) {
            case (60*60*24*7):
                return get_string('numweeks', '', $data['v']);
            case (60*60*24):
                return get_string('numdays', '', $data['v']);
            case (60*60):
                return get_string('numhours', '', $data['v']);
            case (60):
                return get_string('numminutes', '', $data['v']);
            default:
                return get_string('numseconds', '', $data['v']*$data['u']);
        }
    }
1321532
public function getPeriods2()
  {
    $periods = array();

    $this->Period->byOrganizationWithYear($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($Period) use (&$periods)
    {
      // array_push($periods, array('value'=> $Period->id, 'label' => $this->Lang->get('decima-accounting::period-management.' . $Period->month) . ' ' . $Period->year->year));
      array_push($periods, array('value'=> $Period->id, 'label' => $this->Lang->get('decima-accounting::period-management.' . $Period->month) . ' ' . $Period->year));
    });

    return $periods;
  }
43694
protected function getHours()
    {
        $intSecondsPerHour = ($this->isPositive()) ? DateTimeSpan::SECONDS_PER_HOUR : ((-1) * DateTimeSpan::SECONDS_PER_HOUR);
        $intHours = floor($this->intSeconds / $intSecondsPerHour);
        if ($this->isNegative()) {
            $intHours = (-1) * $intHours;
        }
        return $intHours;
    }
36806
public function getRetentionTime()
    {
        if (is_array($this->retentionTimeWindow)) {
            return ($this->retentionTimeWindow[static::RETENTION_TIME_START] +
                $this->retentionTimeWindow[static::RETENTION_TIME_END]) / 2;
        }
        
        return $this->retentionTimeWindow;
    }
502341
public function getTempoEspera()
    {
        if ($this->tempoEspera) {
            return $this->secondsToDateInterval($this->tempoEspera);
        }
        
        $now = new DateTime();
        $interval = $now->diff($this->getDataChegada());

        return $interval;
    }
163027
public function duration($seconds)
    {
        $result = [
            'hour'     => (int) floor($seconds / 3600),
            'min'      => (int) floor(($seconds / 60) % 60),
            'sec'      => $seconds % 60,
            'ms'       => (int) round(\fmod($seconds, 1) * 1000),
        ];

        $duration = '';
        foreach ($result as $unit => $value) {
            if (!empty($value) || $unit === 'ms') {
                $duration .= $value . "$unit ";
            }
        }

        $result['duration'] = trim($duration);

        return $result;
    }
1001534
public function getLifetime() {
        if (!self::$lifetime) {
            $sessionExpirationHours = engineGet('Config', 'sessionExpirationHours', false);
            if (!$sessionExpirationHours)
                $sessionExpirationHours = 2;
            self::$lifetime = 60 * 60 * $sessionExpirationHours;
        }

        return self::$lifetime;
    }
957080
public function getTotalElapsedTime() {
		$time = 0;
		
		foreach ($this->_profiles as $profile) {
			$time += $profile->getElapsedTime();
		}
		
		return $time;
	}
334740
public function get_last_indexing_duration() {
        list($componentname, $varname) = $this->get_config_var_name();
        $start = get_config($componentname, $varname . '_indexingstart');
        $end = get_config($componentname, $varname . '_indexingend');
        if ($start && $end) {
            return $end - $start;
        } else {
            return false;
        }
    }
1333279
public function getDurationInMilliseconds() : float
    {
        if ($this->stoppedOn === null) {
            throw new NotStoppedException();
        }

        return $this->toMilli($this->stoppedOn - $this->startedOn);
    }
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();
    }
125587
public function duration()
	{
		$total = 0;

		foreach ($this->marks as $mark)
		{
			$total += $mark->duration();
		}

		return $total;
	}
301235
public function getFinalFireTime()
    {
        if ($this->getEndTime()) {
            $resultTime = clone $this->getEndTime();
            $resultTime->add(new \DateInterval('PT1S'));

            $resultTime = $this->getTimeBefore($resultTime);
        } else {
            $resultTime = null;
        }

        if ($resultTime && $this->getStartTime() && $resultTime < $this->getStartTime()) {
            return null;
        }

        return $resultTime;
    }
86501
public function getDuration($from = Timer::START, $to = Timer::STOP) {
        $from = $this->getCheckpoint($from);
        $to = $this->getCheckpoint($to);

        if ($from === null) {
            return 0;
        }

        if ($to === null) {
            $to = microtime(true);
        }

        return abs($to - $from);
    }