Besides IO bounded operations, the simplest way to put an action into wait to be executed later is setTimeout. setTimeout(action, 1000) will run action after 1 second. And the program can run whatever during this 1 second wait time. It is like a breathe time for the program.
Read more →