More broadly (these are textbooks, not tutorials), you may want to look at Mangano's (somewhat dated, but still useful) Mathematica Cookbook and Wellin's more recent Programming with Mathematica (see also his other books on http://www.programmingmathematica.com/books.html).
Have a look at the functionality described here: https://reference.wolfram.com/language/guide/TimedEvaluations.html So you can execute repeatedly a piece of code over time, without hogging all your cpu cycles by using a while loop or so...