[java] What's the equivalent of Java's Thread.sleep() in JavaScript?