Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return current Unix timestamp with microseconds
<?php microtime(bool $as_float = false): string|float
<?php {
return class_exists(Carbon::class)
? Carbon::now()->getPreciseTimestamp()
: microtime(true) * 1_000_000;
}
<?php $this->components->task($description, function () use ($event) {
$this->dispatcher->dispatch(new ScheduledTaskStarting($event));
$start = microtime(true);
try {
$event->run($this->laravel);
<?php $this->dispatcher->dispatch(new ScheduledTaskFinished(
$event,
round(microtime(true) - $start, 2)
));
$this->eventsRan = true;
<?php $this->output->write(" $description ", false, $verbosity);
$startTime = microtime(true);
$result = false;
<?php $this->reconnectIfMissingConnection();
$start = microtime(true);
<?php protected function getElapsedTime($start)
{
return round((microtime(true) - $start) * 1000, 2);
}
<?php );
}
$startTime = microtime(true);
$seeder->__invoke($parameters);
<?php $seeder->__invoke($parameters);
if ($silent === false && isset($this->command)) {
$runTime = number_format((microtime(true) - $startTime) * 1000);
with(new TwoColumnDetail($this->command->getOutput()))->render(
$name,
<?php ));
if ($status == 'starting') {
$this->latestStartedAt = microtime(true);
$dots = max(terminal()->width() - mb_strlen($job->resolveName()) - (
$this->output->isVerbose() ? (mb_strlen($job->getJobId()) + 1) : 0
<?php public function command($method, array $parameters = [])
{
$start = microtime(true);
$result = $this->client->{$method}(...$parameters);
<?php $result = $this->client->{$method}(...$parameters);
$time = round((microtime(true) - $start) * 1000, 2);
if (isset($this->events)) {
$this->event(new CommandExecuted(
<?php public function acquire()
{
$results = $this->redis->eval(
$this->luaScript(), 1, $this->name, microtime(true), time(), $this->decay, $this->maxLocks
);
$this->decaysAt = $results[1];
<?php public function tooManyAttempts()
{
[$this->decaysAt, $this->remaining] = $this->redis->eval(
$this->tooManyAttemptsLuaScript(), 1, $this->name, microtime(true), time(), $this->decay, $this->maxLocks
);
return $this->remaining <= 0;
<?php protected function runTimeForHumans($startTime, $endTime = null)
{
$endTime ??= microtime(true);
$runTime = ($endTime - $startTime) * 1000;
<?php {
$exception = null;
$start = microtime(true);
try {
$result = $callback($this);