Page 1 of 1

Time-Loopings

Posted: Thu Jul 10, 2003 5:29 am
by Tubbietoeter
Hi guys,


I got a function that checks on a status. It must loop until $flag=="true".

Code: Select all

$flag="false";
  while (flag=="false") {
    if (check_is_okay()) {
          $flag="true";
    } else {
         do_something_else();
    }
  }
Since I know it will take some time I want to loop the function in a 5 second interval or something like that.

Has anyone a hint on how to do that?

Posted: Thu Jul 10, 2003 5:33 am
by ik
Hi!
Try to use register_tick() instead of loop.

Posted: Thu Jul 10, 2003 6:12 am
by Tubbietoeter
uh, i dont think this will work for me? if a tick is something like a process counter ... well the loop is the only thing that is to be executed at this point of the script.

Posted: Thu Jul 10, 2003 6:27 am
by ik
ups.... Sorry :(
I oriented by name (tick!) an thought it's a timer callback, as usual.

Posted: Thu Jul 10, 2003 6:29 am
by Tubbietoeter
ah got it!!

what i need is the sleep-function ... thanks anyways ... ;o)