if there is no wait in your myfunc-function, there is no Usage for the Wait_for.
My English is to bad to explain it
A test Code showing the behaviour of wait
function fuu()
{
printf("2 in fuu");
wait(1);
printf("3 in fuu after wait");
}
function main()
{
level_load("");
printf("1 before fuu");
fuu();
printf("4 after fuu");
}
The output with wait is
1 before fuu
2 in fuu
4 after fuu
3 in fuu after wait
The output if wait is commented out
1 before fuu
2 in fuu
3 in fuu after wait
4 after fuu
The solution of Mr.Guest to make it recursive is very bad.
Using an recursive solution for an endless loop fills the stack fast resulting that the program/system crashes
main() {
myent=ent_create(...);
myent.event=whatever;
}
void whatever() {
while(1) {
myfunc();
wait(1);
}
}
void myfunc() {
do some writes into the file
using no wait
}
this will be OK if you don't use a wait in myfunc
EDIT:
Why do you start an endless lopp inside an event??
Each call of the event results to one more endless loop
muffel