Commit f3a72313 authored by webchick's avatar webchick

Issue #2173335 by sun: Remove deprecated timer_* functions.

parent 6f3e437f
......@@ -14,6 +14,7 @@
* @see batch_get()
*/
use Drupal\Component\Utility\Timer;
use Drupal\Core\Batch\Percentage;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
......@@ -214,7 +215,7 @@ function _batch_process() {
// proceed with the same batch phase when a processing time of 1 second has
// been exceeded.
if ($batch['progressive']) {
timer_start('batch_processing');
Timer::start('batch_processing');
}
if (empty($current_set['start'])) {
......@@ -277,7 +278,7 @@ function _batch_process() {
$queue = _batch_queue($current_set);
// If we are in progressive mode, break processing after 1 second.
if ($batch['progressive'] && timer_read('batch_processing') > 1000) {
if ($batch['progressive'] && Timer::read('batch_processing') > 1000) {
// Record elapsed wall clock time.
$current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2);
break;
......
......@@ -222,30 +222,6 @@
*/
define('DRUPAL_ROOT', dirname(dirname(__DIR__)));
/**
* @deprecated as of Drupal 8.0.
* @see \Drupal\Component\Utility\Timer::start
*/
function timer_start($name) {
Timer::start($name);
}
/**
* @deprecated as of Drupal 8.0.
* @see \Drupal\Component\Utility\Timer::read
*/
function timer_read($name) {
return Timer::read($name);
}
/**
* @deprecated as of Drupal 8.0.
* @see \Drupal\Component\Utility\Timer::stop
*/
function timer_stop($name) {
return Timer::stop($name);
}
/**
* Returns the appropriate configuration directory.
*
......
......@@ -7,6 +7,7 @@
namespace Drupal\views_ui;
use Drupal\Component\Utility\Timer;
use Drupal\views\Views;
use Drupal\Core\Entity\EntityStorageControllerInterface;
use Drupal\views\ViewExecutable;
......@@ -612,7 +613,7 @@ public function renderPreview($display_id, $args = array()) {
$show_additional_queries = $config->get('ui.show.additional_queries');
timer_start('views_ui.preview');
Timer::start('views_ui.preview');
if ($show_additional_queries) {
$this->startQueryCapture();
......@@ -626,7 +627,7 @@ public function renderPreview($display_id, $args = array()) {
$this->endQueryCapture();
}
$this->render_time = timer_stop('views_ui.preview');
$this->render_time = Timer::stop('views_ui.preview');
views_ui_contextual_links_suppress_pop();
......
......@@ -6,6 +6,7 @@
require_once __DIR__ . '/../vendor/autoload.php';
use Drupal\Component\Utility\Timer;
use Drupal\Core\StreamWrapper\PublicStream;
const SIMPLETEST_SCRIPT_COLOR_PASS = 32; // Green.
......@@ -724,7 +725,7 @@ function simpletest_script_reporter_init() {
echo "Test run started:\n";
echo " " . format_date($_SERVER['REQUEST_TIME'], 'long') . "\n";
timer_start('run-tests');
Timer::start('run-tests');
echo "\n";
echo "Test summary\n";
......@@ -807,7 +808,7 @@ function simpletest_script_reporter_write_xml_results() {
*/
function simpletest_script_reporter_timer_stop() {
echo "\n";
$end = timer_stop('run-tests');
$end = Timer::stop('run-tests');
echo "Test run duration: " . format_interval($end['time'] / 1000);
echo "\n\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment