Build fix in Mac

redefine the sleep function