Your questions might be interpreted in a variety of ways, I’m not sure how to approach them the way you want but since you’re not a programmer, I’ll go with something basic.
The first thing I can think of is “loops”. A program (or parts of it) can be made to run in loops, as in repeating an action again and again until an exit condition is met. This can be utilized in a way, like checking “if x has occurred” every time the code loops.
The instructions would look like
– loop this segment of code until y is completed:
– check if x occurred:
– yes: then complete y
– no: then do nothing
Assume this loop executes every 100ms, this would ensure you will be completing y in around ~100ms after x occurs. You don’t know when x is going to occur, but your program would catch it during the first iteration once it does. This way your program is able to wait for a future input, or at least act like it’s waiting for it.
You might also want to check out [event-driven programming.](https://en.wikipedia.org/wiki/Event-driven_programming)
Latest Answers