Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ParisLiakos on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Description:
All timer related functions have been moved to a new Timer component.
D7
// Start a page timer:
timer_start('page');
timer_read('page');
timer_stop('page');
D8
use Drupal\Component\Utility\Timer;
// Start a page timer:
Timer::start('page');;
Timer::read('page');
Timer::stop('page');
It has also been decided to move the replacement of timer component with Symphony Stopwatch to Drupal version 9 as it requires changes in the core API. (related issue)
Impacts:
Module developers