diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index b467b4f..b2e01b4 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -329,7 +329,7 @@ /** * @deprecated as of Drupal 8.0. - * @see Drupal\Component\Utility\Timer::start + * @see \Drupal\Component\Utility\Timer::start */ function timer_start($name) { Timer::start($name); @@ -337,7 +337,7 @@ function timer_start($name) { /** * @deprecated as of Drupal 8.0. - * @see Drupal\Component\Utility\Timer::read + * @see \Drupal\Component\Utility\Timer::read */ function timer_read($name) { return Timer::read($name); @@ -345,7 +345,7 @@ function timer_read($name) { /** * @deprecated as of Drupal 8.0. - * @see Drupal\Component\Utility\Timer::stop + * @see \Drupal\Component\Utility\Timer::stop */ function timer_stop($name) { return Timer::stop($name); @@ -2230,15 +2230,14 @@ function _drupal_bootstrap_configuration() { // Initialize the configuration, including variables from settings.php. drupal_settings_initialize(); + // Make sure we are using the test database prefix in child Drupal sites. + _drupal_initialize_db_test_prefix(); + // Activate the class loader. drupal_classloader(); // Start a page timer: - timer_start('page'); - - // Make sure we are using the test database prefix in child Drupal sites. - _drupal_initialize_db_test_prefix(); - + Timer::start('page'); // Load the procedural configuration system helper functions. require_once DRUPAL_ROOT . '/core/includes/config.inc'; diff --git a/core/lib/Drupal/Component/Utility/Timer.php b/core/lib/Drupal/Component/Utility/Timer.php index f16d92b..294632c 100644 --- a/core/lib/Drupal/Component/Utility/Timer.php +++ b/core/lib/Drupal/Component/Utility/Timer.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\Component\Utility\Timer + * Contains \Drupal\Component\Utility\Timer. */ namespace Drupal\Component\Utility; @@ -31,10 +31,10 @@ static public function start($name) { /** * Reads the current timer value without stopping the timer. * - * @param $name + * @param string $name * The name of the timer. * - * @return + * @return int * The current timer value in ms. */ static public function read($name) { @@ -53,10 +53,10 @@ static public function read($name) { /** * Stops the timer with the specified name. * - * @param $name + * @param string $name * The name of the timer. * - * @return + * @return array * A timer array. The array contains the number of times the timer has been * started and stopped (count) and the accumulated timer value in ms (time). */ @@ -75,4 +75,5 @@ static public function stop($name) { return static::$timers[$name]; } + } diff --git a/core/tests/Drupal/Tests/Component/Utility/TimerUnitTest.php b/core/tests/Drupal/Tests/Component/Utility/TimerUnitTest.php index c50e4f5..9980e0f 100644 --- a/core/tests/Drupal/Tests/Component/Utility/TimerUnitTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/TimerUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\Tests\Component\Utility\TimerUnitTest. + * Contains \Drupal\Tests\Component\Utility\TimerUnitTest. */ namespace Drupal\Tests\Component\Utility; @@ -13,7 +13,7 @@ /** * Tests the Timer system. * - * @see Drupal\Component\Utility\Timer + * @see \Drupal\Component\Utility\Timer */ class TimerUnitTest extends UnitTestCase { @@ -53,4 +53,5 @@ function testTimer() { $this->assertGreaterThanOrEqual(20, $value4, 'Timer measured 20 milliseconds of sleeping while running.'); $this->assertLessThan(25, $value4, 'Timer measured 20 milliseconds of sleeping while running.'); } + }