added sleep_ticks and thread_sleep