Added check for windows before implementing sleep() workaround