static void sleep(long ms) { ping(); //if (isAWTThread()) 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(); } }