Posted 12 April 2014 - 07:18 PM
So, I know how to make a random number generator, but I also have no idea how to get the computer to do two things at once. Specifically, I have a monitor hooked up to a computer with the abilty to have touch screen. Basically, what I want to do is generate a random number every t seconds while also waiting for the user to press the big red stop button on the monitor. Once the button is pressed, it'll stop generating numbers and do something else. I was thinking that sleep(t) would work, but I believe that it just makes the computer do absolutely nothing for a while.