Adapt sleep function to windows