How to use the sleep function?