modified milli_sleep