Ensure main thread timer registration.
Update example for new API