After searching hours and hours and debugging and whatnot seems like i just cant find a solution to so simple problem... what i need is something like this
for(int i=0; i<100; i++)
{
wait here 2-3 seconds
string result = doSomeGUIworkHere();
if(result == desiredResult)
{
break;
}
}
I tried Thread.Sleep, timer with elapsed event, task delay with async await... But to no awail. If i use thread.sleep it just blocks thread and wont do doSomeGUIworkHere();
If i use timer then it just fires doSomeGUIworkHere(); 100 times.
Please help.
for(int i=0; i<100; i++)
{
wait here 2-3 seconds
string result = doSomeGUIworkHere();
if(result == desiredResult)
{
break;
}
}
I tried Thread.Sleep, timer with elapsed event, task delay with async await... But to no awail. If i use thread.sleep it just blocks thread and wont do doSomeGUIworkHere();
If i use timer then it just fires doSomeGUIworkHere(); 100 times.
Please help.



![[Image: signature.png]](https://raw.githubusercontent.com/CodeElements/CodeElements.Suite/master/signature.png)