JBZoo\Utils\Sys::setTime PHP Method

setTime() public static method

Set PHP execution time limit (doesn't work in safe mode)
public static setTime ( integer $newLimit )
$newLimit integer
    public static function setTime($newLimit = 0)
    {
        $newLimit = (int) $newLimit;
        self::iniSet('set_time_limit', $newLimit);
        self::iniSet('max_execution_time', $newLimit);
        if (self::isFunc('set_time_limit') && !ini_get('safe_mode')) {
            set_time_limit($newLimit);
        }
    }

Usage Example

Example #1
0
 public function testSetTimeAndMemory()
 {
     Sys::setTime(1800);
     Sys::setMemory('128M');
     isSame('128M', Sys::iniGet('memory_limit'));
     //isSame('1800', Sys::iniGet('set_time_limit'));
     //isSame('1800', Sys::iniGet('max_execution_time'));
 }
All Usage Examples Of JBZoo\Utils\Sys::setTime