Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/user/bin/php
- $start = microtime(true);
- set_time_limit(60);
- for (i = 0; i < 59; ++$i) {
- doMyThings();
- time_sleep_until($start + $i + 1);
- }
- set_time_limit(60);
- for (i = 0; i < 59; ++$i) {
- doMyThings();
- sleep(1);
- }
- $start = microtime(true);
- set_time_limit(60);
- for (i = 0; i < 59; ++$i) {
- doMyThings();
- time_sleep_until($start + $i + 1);
- }
- #!/user/bin/php
- <?php
- while($i < 60) {
- sleep(1);
- //do stuff
- $i++;
- }
- ?>
- #!/usr/bin/php
- <?
- $start = microtime(true);
- set_time_limit(60);
- for ($i = 0; $i < 59; ++$i) {
- echo $i;
- time_sleep_until($start + $i + 1);
- }
- ?>
Add Comment
Please, Sign In to add comment