public static long testCont(Sleep ex) throws Exception { System.gc(); try { Thread.sleep(100); } catch (Exception e) { } long start = System.currentTimeMillis(); if (pausable) { // Manually doing what the scheduler would do, just to cut out the // thread scheduling. Fiber f = new Fiber(ex); while (true) { ex.execute(f.begin()); if (f.end()) break; } } else { ex.noPauseRun(); } return (System.currentTimeMillis() - start); }