static void sleep(long ms) { ping(); if (ms <= 0) ret; // allow spin locks if (isAWTThread() && ms > 100) fail("Should not sleep on AWT thread"); try { Thread.sleep(ms); } catch (Exception e) { throw new RuntimeException(e); } } static void sleep() ctex { print("Sleeping."); synchronized(main.class) { main.class.wait(); } }