clock used by stopwatch is now configurable
use a timer instead of sleeping

Using a timer seems to prevent the output to drift.