Returns the total number of microseconds in this Duration.

The result is rounded towards negative infinity.

@return int
177753
public function getTotalMicros() : int
    {
        $micros = $this->seconds * 1000000;
        $micros += \intdiv($this->nanos, 1000);

        return $micros;
    }
215313
public static double durationMilliOf(long startTimeNano, long endTimeNano) {
        double micros = (double)TimeUnit.NANOSECONDS.toMicros(endTimeNano - startTimeNano);
        return micros / 1000.0; // convert microseconds to milliseconds in double rather than long, preserving the precision
    }
693117
public function getElapsedInMilliseconds() : float
    {
        if ($this->startedOn === null) {
            throw new NotStartedException();
        }

        return ($this->stoppedOn === null) ?
            $this->toMilli(microtime(true) - $this->startedOn) :
            $this->getDurationInMilliseconds();
    }
1177204
public function getTotalDuration(): float
    {
        $time = 0;
        foreach ($this->data['queries'] as $command) {
            $time += $command['duration'];
        }

        return $time;
    }
965467
public function getDuration()
    {
        if (!isset($this->data['events']['__section__'])) {
            return 0;
        }

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

        return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime();
    }
51806
public int toIntSeconds() {
    int _minutes = getHours() * 60;
    _minutes += getMinutes();
    int _seconds = _minutes * 60;
    _seconds += getSeconds();
    return _seconds;
  }
529413
public function timeTaken()
    {
        $timeStop = microtime(true);
        $timeTaken = (float) substr(-($this->timeStarted - $timeStop), 0, 5);
        return $timeTaken;
    }
820097
function milliseconds( $dp = null ){
	 	if( $this->is_running() ){
		 	$now = microtime( false );
		}
		else {
			$now = $this->stopped;
		}
		$started = self::parse_microtime( $this->started );
		$stopped = self::parse_microtime( $now );
		$ms = $stopped - $started;
		if( ! is_null($dp) ){
			$mult = pow( 10, $dp );
			$ms = round( $mult * $ms ) / $mult;
		}
		return $ms;
	 }
522082
public function getMicroseconds($asSeconds = false)
    {
        if ($asSeconds) {
            return round($this->microseconds * 1/1e6, 6);
        }

        return intval($this->microseconds);
    }
1228202
public function isActive()
	{
		$this->numberChecks++;
		$time	= microtime( TRUE ) - $this->time;
		return $time < $this->seconds;
	}
479703
function time(): int {
        if($this->nativeHrtime) {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \hrtime(true);
            $elapsed = (int) ($time - $this->lastTime);
            $this->lastTime = $time;
        } elseif($this->hrtime) {
            $this->timer->stop();
            $elapsed = (int) $this->timer->getLastElapsedTime(\HRTime\Unit::NANOSECOND);
            $this->timer->start();
        } else {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \microtime(true);
            $elapsed = $time - $this->lastTime;
            
            $this->lastTime = $time;
            $elapsed = \ceil(($elapsed * 1000000000));
        }
        
        return ((int) $elapsed);
    }
1011361
public double getDuration() {
    Map<String, Object> meta = getFileMetaData();
    if (meta != null && meta.containsKey(DURATION)) {
      return ((Number) meta.get(DURATION)).doubleValue();
    }
    return 0;
  }
187700
public function getTotalSeconds()
	{
		// Use the days value if it is available otherwise the months value will be used which gives
		// nonsense results when the duration has been created from a day interval because the
		// DateInterval assumes 30 days to every month!
		// BMS 2018-03-20 Changed to look at the 'daysOnly' property and use the 'd' value if it is.
		//				  On this date the parent::getTotalSeconds() function returns a value that is out by an hour
		//				  when returning the interval of this expression:
		//				  (xs:dateTime("1999-10-23T09:08:07Z") - xs:dateTime("1998-09-09T04:03:02Z"))
		//				  which appears in test 'op-subtract-dateTimes-yielding-DTD-19' in 'dateTimesSubtract.xml'
		//				  This interval is 408 days 22 hours 58 minutes and 59 seconds

		if ( ! $this->Value->days && ( $this->Value->y || $this->Value->m ) ) return parent::getTotalSeconds();
		// if ( ! $this->Value->days && ! $this->Value->daysOnly ) return parent::getTotalSeconds();

		$seconds = new DecimalValue( ( $this->Value->days ? $this->Value->days : $this->Value->d ) * 86400 + $this->Value->h * 3600 + $this->Value->i * 60 + $this->Value->s );
		$seconds = $seconds->Add( "0.{$this->Value->microseconds}" );
		if ( $this->Value->invert )
		{
			$seconds = $seconds->Mul( -1 );
		}

		return $seconds;
	}
182228
public static function getDuration($start)
    {
        $time = microtime();
        $time = explode(' ', $time);
        $time = $time[1] + $time[0];
        $finish = $time;
        
        return round(($finish - $start), 4);
    }
1132966
public function getDuration() : ?int 
    {
        if ( ! $this->hasDuration()) {
            $this->setDuration($this->getDefaultDuration());
        }
        return $this->duration;
    }
804206
public function duration(): ?float
    {
        $endTime = $this->call->endTime();

        if (null === $endTime) {
            return null;
        }

        return $endTime - $this->call->time();
    }
174289
public function toSeconds()
    {
        $seconds = $this->s;
        $seconds += $this->i * 60;
        $seconds += $this->h * 3600;
        
        if ($this->days) {
            $seconds += $this->days * 86400;
        } else {
            if ($this->d) {
                $seconds += $this->d * 86400;
            }
            if ($this->m) {
                trigger_error('Calculating seconds for interval with months property. Result may not be accurate.', E_USER_WARNING);
                $seconds += 2629800;
            }
            if ($this->y) {
                trigger_error('Calculating seconds for interval with years property. Result may not be accurate.', E_USER_WARNING);
                $seconds += $this->y * 31557600;
            }
        }
        return $seconds;
    }