Added stopwatch class for timed events on a separate thread