Set interval repeats the same process at the given time even if the process has not finished yet. This is better. It waits for doStuff to finish before it starts the timeout.