timer_read

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 timer_read($name)

Read the current timer value without stopping the timer.

Übergabeparameter

name The name of the timer.

Rückgabewert

The current timer value in ms.

▾ 3 functions call timer_read()

statistics_exit in modules/statistics/statistics.module
Implementation of hook_exit().
timer_stop in includes/bootstrap.inc
Stop the timer with the specified name.
_batch_process in includes/batch.inc
Advance batch processing for 1 second (or process the whole batch if it was not set for progressive execution - e.g forms submitted by drupal_execute).

Code

includes/bootstrap.inc, line 246

<?php
function timer_read($name) {
  global $timers;

  if (isset($timers[$name]['start'])) {
    list($usec, $sec) = explode(' ', microtime());
    $stop = (float) $usec + (float) $sec;
    $diff = round(($stop - $timers[$name]['start']) * 1000, 2);

    if (isset($timers[$name]['time'])) {
      $diff += $timers[$name]['time'];
    }
    return $diff;
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen