Use BackgroundWorker instead of timer in demo.
Reset counter on input mode change.