So if i have some boolean that keeps changing from false to true and from true to false how can i know if it stays false for a chosen number of seconds? and still not pausing my code just to wait for it to be false for some seconds... and each time it becomes true the the timer resets
EDIT: Thats all what i tried but as expected it pauses everything and keeps waiting for the chosen number of seconds
static bool IsFalseFor(int MILseconds, bool Target)
{
while (Target == false)
{
for(int i = 0; i != 10; i++)
{
if(Target == true)
{
return false;
}
Thread.Sleep(MILseconds/10);
}
return true;
}
return false;
}