👁 查看:class-timer.php
路径:/home/forge/kingkrunch.com/wp/wp-content/plugins/wp-smush-pro/core/class-timer.php
大小:376 B · 修改:2026-09-29 06:58:27 · 权限:0644 · 可写
<?php

namespace Smush\Core;

class Timer {
	/**
	 * @var float
	 */
	private $time_start;

	public function start() {
		$this->time_start = microtime( true );
	}

	public function end( $round = true ) {
		$time_end = microtime( true );
		$time     = $time_end - $this->time_start;
		if ( $round ) {
			$time = round( $time, 2 );
		}
		return $time;
	}
}