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

Breadcrumb

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

function Timing::printRunTime

Print information about the run.

Parameters

boolean $force If TRUE, prints the output even if it has: already been printed during the run.

Return value

void

9 calls to Timing::printRunTime()
Cbf::generate in vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php
Prints a summary of fixed files.
Code::generate in vendor/squizlabs/php_codesniffer/src/Reports/Code.php
Prints all errors and warnings for each file processed.
Full::generate in vendor/squizlabs/php_codesniffer/src/Reports/Full.php
Prints all errors and warnings for each file processed.
Info::generate in vendor/squizlabs/php_codesniffer/src/Reports/Info.php
Prints the recorded metrics.
Runner::runPHPCBF in vendor/squizlabs/php_codesniffer/src/Runner.php
Run the PHPCBF script.

... See full list

File

vendor/squizlabs/php_codesniffer/src/Util/Timing.php, line 110

Class

Timing

Namespace

PHP_CodeSniffer\Util

Code

public static function printRunTime($force = false) {
    if ($force === false && self::$printed === true) {
        // A double call.
        return;
    }
    if (self::$startTime === null) {
        // Timing was never started.
        return;
    }
    $duration = self::getDuration();
    $duration = self::getHumanReadableDuration($duration);
    $mem = round(memory_get_peak_usage(true) / (1024 * 1024), 2) . 'MB';
    echo "Time: {$duration}; Memory: {$mem}" . PHP_EOL . PHP_EOL;
    self::$printed = true;
}

API Navigation

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