Results of 1 - 2 of about 2 for doWait (0.001 sec.)
- Pause the CPU usage timer 9357
- « LuaSandbox::loadString LuaSandbox::registerLibrary » PHP Manual LuaSandbox Pause the CPU usage timer 検索 LuaSandbox::pauseUsageTimer (PECL luasandbox >= 1.4.0) LuaSandbox::pauseUsageTimer — Pause the CPU usage timer 説明 public function
... <?php // create a new LuaSandbox and set a CPU limit $sandbox = new LuaSandbox (); $sandbox -> setCPULimit ( 1 ); function doWait ( $t ) { $end = microtime ( true ) + $t ; while ( microtime ( true ) < $end ) { // waste CPU cycles } } // Register a PHP ... callback $sandbox -> registerLibrary ( 'php' , [ 'test' => function () use ( $sandbox ) { $sandbox -> pauseUsageTimer (); doWait ( 5 ); $sandbox -> unpauseUsageTimer (); doWait ( 0.1 ); }, 'test2' => function () use ( $sandbox ) { $sandbox -> pauseUsa ... geTimer (); $sandbox -> unpauseUsageTimer (); doWait ( 1.1 ); } ] ); echo "This should not time out...\n" ; $sandbox -> loadString ( 'php.test()' )-> call (); echo "This shoul ...
-
https://man.mtool.work/php/8.3/luasandbox.pauseusagetimer.html
- Pause the CPU usage timer 9357
- « LuaSandbox::loadString LuaSandbox::registerLibrary » PHP Manual LuaSandbox Pause the CPU usage timer 検索 LuaSandbox::pauseUsageTimer (PECL luasandbox >= 1.4.0) LuaSandbox::pauseUsageTimer — Pause the CPU usage timer 説明 public function
... <?php // create a new LuaSandbox and set a CPU limit $sandbox = new LuaSandbox (); $sandbox -> setCPULimit ( 1 ); function doWait ( $t ) { $end = microtime ( true ) + $t ; while ( microtime ( true ) < $end ) { // waste CPU cycles } } // Register a PHP ... callback $sandbox -> registerLibrary ( 'php' , [ 'test' => function () use ( $sandbox ) { $sandbox -> pauseUsageTimer (); doWait ( 5 ); $sandbox -> unpauseUsageTimer (); doWait ( 0.1 ); }, 'test2' => function () use ( $sandbox ) { $sandbox -> pauseUsa ... geTimer (); $sandbox -> unpauseUsageTimer (); doWait ( 1.1 ); } ] ); echo "This should not time out...\n" ; $sandbox -> loadString ( 'php.test()' )-> call (); echo "This shoul ...
-
https://man.mtool.work/php/8.3/luasandbox.pauseusagetimer.html
PREV
1
NEXT