Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2. //Set our time variable at the start of the script
  3. $start = time();
  4.  
  5. //Set the counter to run
  6. $runCounter = TRUE;
  7.  
  8. //Start our loop
  9. while (1) {
  10.     if ($runCounter = TRUE) {
  11.         //Calculate how many seconds after start
  12.         $counter = time() - $start;
  13.     }
  14.    
  15.     if ($counter > 29 && $runCounter == TRUE) {
  16.         //Stop the counter running as we no longer need it
  17.         $runCounter = FALSE;
  18.        
  19.         //Run your action here, it will execute after 29 seconds (on the 30th second)
  20.     }
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement