Set up tick event loop