danack / looping-exec
A function for running code in a loop.
Fund package maintenance!
Danack
0.3.0
2021-03-03 17:59 UTC
Requires
- ext-pcntl: *
Requires (Dev)
- danack/coding-standard: 0.2.0
- phpunit/phpunit: 9.0.1
- slevomat/coding-standard: ^4.8.4
- squizlabs/php_codesniffer: ^3.3.1
- yoast/yoastcs: 1.0
This package is auto-updated.
Last update: 2024-11-29 06:04:00 UTC
README
A function library to allow repeatedly running a callable for a certain amount of time before returning.
Please note, parameters are open to change.
Example
<?php require __DIR__ . "/vendor/autoload.php"; use function LoopingExec\continuallyExecuteCallable; $fn = function () { static $count = 0; echo "Hello world: $count\n"; $count += 1; }; continuallyExecuteCallable( $fn, 5, 1000, 0 ); // output is: // Hello world: 0 // Hello world: 1 // Hello world: 2 // Hello world: 3 // Hello world: 4