Added sleep compatibility for Windows and Unix