0 ) { $budget = min( self::MAX_SECONDS, 0.5 * $max ); } /** * Filter the per-tick time budget in seconds. * * @param float $budget Seconds. * @param int $max max_execution_time (0 = unlimited). */ $budget = (float) apply_filters( 'brverify_tick_budget', $budget, $max ); return max( self::MIN_SECONDS, min( self::MAX_SECONDS, $budget ) ); } /** * Budget seconds for the current tick. */ public static function seconds(): float { if ( null === self::$seconds ) { self::start(); } return (float) self::$seconds; } /** * Absolute deadline (microtime) for the current tick. */ public static function deadline(): float { if ( null === self::$start ) { self::start(); } return (float) self::$start + self::seconds(); } /** * Seconds left in the current tick. */ public static function remaining(): float { return self::deadline() - microtime( true ); } }