Hello, I've searched this topic and all I've found is pages on the sleep() function. Basically I want my program to execute a function after a Boolean expression has been false for a certain amount of time. What I'm doing is a object mouse with a small ball that will click if I close the ball in my hand. I can get it to click if the object is not detected, but it clicks even if the object isn't detected for 1ms. Basically I want to have it so if the objected is found is false for a certain amount of time it will click. Is there anyway I can do this in C++?
There are a couple of ways, either with multiple threads or by checking the amount of time that has elapsed since the last iteration of your running loop.