implemented timer_sleep