Adds local_sleep() function for testing