int (int ms, @NotNull Runnable doWhileWait) { long deadline = System.currentTimeMillis() + ms; int nap = Math.max(1, ms / 100); while (System.currentTimeMillis() < deadline) { TimeoutUtil.sleep(nap); doWhileWait.run(); } return COUNT.incrementAndGet(); }