SILENT KILLERPanel

Current Path: > home > transcarter > public_html > wp-content > plugins > query-monitor > classes


Operation   : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Software     : Apache
Server IP    : 198.54.126.42 | Your IP: 216.73.216.135
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/transcarter/public_html/wp-content/plugins/query-monitor/classes

NameTypeSizeLast ModifiedActions
Activation.php File 3038 bytes July 17 2025 21:05:45.
Backtrace.php File 14755 bytes July 17 2025 21:05:45.
CLI.php File 1568 bytes July 17 2025 21:05:45.
Collector.php File 8676 bytes July 17 2025 21:05:45.
Collector_Assets.php File 13804 bytes July 17 2025 21:05:45.
Collectors.php File 1923 bytes July 17 2025 21:05:45.
Component.php File 257 bytes July 17 2025 21:05:45.
DB.php File 1601 bytes July 17 2025 21:05:45.
Data.php File 1343 bytes July 17 2025 21:05:45.
DataCollector.php File 396 bytes July 17 2025 21:05:45.
Dispatcher.php File 5244 bytes July 17 2025 21:05:45.
Dispatchers.php File 1241 bytes July 17 2025 21:05:45.
Hook.php File 1706 bytes July 17 2025 21:05:45.
Output.php File 923 bytes July 17 2025 21:05:45.
PHP.php File 1397 bytes July 17 2025 21:05:45.
Plugin.php File 2400 bytes July 17 2025 21:05:45.
QM.php File 4443 bytes July 17 2025 21:05:45.
QueryMonitor.php File 8688 bytes July 17 2025 21:05:45.
Timer.php File 2923 bytes July 17 2025 21:05:45.
Util.php File 19534 bytes July 17 2025 21:05:45.
debug_bar.php File 1713 bytes July 17 2025 21:05:45.
debug_bar_panel.php File 1446 bytes July 17 2025 21:05:45.

Reading File: /home/transcarter/public_html/wp-content/plugins/query-monitor/classes/Timer.php

<?php declare(strict_types = 1);
/**
 * Timer that collects timing and memory usage.
 *
 * @package query-monitor
 */

class QM_Timer {

	/**
	 * @var array<string, mixed>
	 * @phpstan-var array{
	 *   time: float,
	 *   memory: int,
	 *   data: mixed[]|null,
	 * }
	 */
	protected $start;

	/**
	 * @var array<string, mixed>|null
	 * @phpstan-var array{
	 *   time: float,
	 *   memory: int,
	 *   data: mixed[]|null,
	 * }|null
	 */
	protected $end = null;

	/**
	 * @var QM_Backtrace
	 */
	protected $trace;

	/**
	 * @var array<string, array<string, mixed>>
	 * @phpstan-var array<string, array{
	 *   time: float,
	 *   memory: int,
	 *   data: mixed[]|null,
	 * }>
	 */
	protected $laps = array();

	/**
	 * @param mixed[] $data
	 * @return self
	 */
	public function start( ?array $data = null ) {
		$this->trace = new QM_Backtrace();
		$this->start = array(
			'time' => microtime( true ),
			'memory' => memory_get_usage(),
			'data' => $data,
		);
		return $this;
	}

	/**
	 * @param mixed[] $data
	 * @return self
	 */
	public function stop( ?array $data = null ) {

		$this->end = array(
			'time' => microtime( true ),
			'memory' => memory_get_usage(),
			'data' => $data,
		);

		return $this;

	}

	/**
	 * @param mixed[] $data
	 * @param string $name
	 * @return self
	 */
	public function lap( ?array $data = null, ?string $name = null ) {

		$lap = array(
			'time' => microtime( true ),
			'memory' => memory_get_usage(),
			'data' => $data,
		);

		if ( ! isset( $name ) ) {
			$i = sprintf(
				/* translators: %s: Timing lap number */
				__( 'Lap %s', 'query-monitor' ),
				number_format_i18n( count( $this->laps ) + 1 )
			);
		} else {
			$i = $name;
		}

		$this->laps[ $i ] = $lap;

		return $this;

	}

	/**
	 * @return mixed[]
	 */
	public function get_laps() {

		$laps = array();
		$prev = $this->start;

		foreach ( $this->laps as $lap_id => $lap ) {

			$lap['time_used'] = $lap['time'] - $prev['time'];
			$lap['memory_used'] = $lap['memory'] - $prev['memory'];

			$laps[ $lap_id ] = $lap;
			$prev = $lap;

		}

		return $laps;

	}

	/**
	 * @return float
	 */
	public function get_time() {
		return $this->end['time'] - $this->start['time'];
	}

	/**
	 * @return int
	 */
	public function get_memory() {
		return $this->end['memory'] - $this->start['memory'];
	}

	/**
	 * @return float
	 */
	public function get_start_time() {
		return $this->start['time'];
	}

	/**
	 * @return int
	 */
	public function get_start_memory() {
		return $this->start['memory'];
	}

	/**
	 * @return float
	 */
	public function get_end_time() {
		return $this->end['time'];
	}

	/**
	 * @return int
	 */
	public function get_end_memory() {
		return $this->end['memory'];
	}

	/**
	 * @return QM_Backtrace
	 */
	public function get_trace() {
		return $this->trace;
	}

	/**
	 * @param mixed[] $data
	 * @return self
	 */
	public function end( ?array $data = null ) {
		return $this->stop( $data );
	}

}

SILENT KILLER Tool