the new implement of timer and message loop