Async statement

The async statement makes async programming a lot easier. Just wrap your async code in the async block. Supply name(s) of callback functions that should be called when the async action ends and call those name(s) as if they were a function.

this first print 'begin', then after one second it will print 'first tieout', and two seconds after 'begin' it will print 'second timeout'. After it has printed 'first timeout' and 'second timeout' it will print 'end'.