Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Timer.php

function Timer::start

Same name in this branch
  1. 11.1.x vendor/phpunit/php-timer/src/Timer.php \SebastianBergmann\Timer\Timer::start()

Starts the timer with the specified name.

If you start and stop the same timer multiple times, the measured intervals will be accumulated.

Parameters

string $name: The name of the timer.

3 calls to Timer::start()
Cron::invokeCronHandlers in core/lib/Drupal/Core/Cron.php
Invokes any cron handlers implementing hook_cron.
ViewUI::renderPreview in core/modules/views_ui/src/ViewUI.php
_batch_process in core/includes/batch.inc
Processes sets in a batch.

File

core/lib/Drupal/Component/Utility/Timer.php, line 23

Class

Timer
Provides helpers to use timers throughout a request.

Namespace

Drupal\Component\Utility

Code

public static function start($name) {
    static::$timers[$name]['start'] = microtime(TRUE);
    static::$timers[$name]['count'] = isset(static::$timers[$name]['count']) ? ++static::$timers[$name]['count'] : 1;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal