publicstaticvoid doTestOtherThreadWait() throws Exception {
System.out.println("################################");
System.out.println("### Other thread (suspended) ###");
System.out.println("################################"); final ControlData data = new ControlData();
data.waitFor = new Object(); Thread t = newThread("Frames doTestOtherThreadWait") { publicvoid run() {
Recurse.foo(4, 0, 0, data);
}
};
t.start();
data.reached.await(); Thread.yield(); Thread.sleep(500); // A little bit of time...
int count = getFrameCount(t);
System.out.println(count); try {
System.out.println(Arrays.toString(getFrameLocation(t, -1)));
} catch (RuntimeException e) {
System.out.println(e.getMessage());
} for (int i = 0; i < count; i++) {
System.out.println(Arrays.toString(getFrameLocation(t, i)));
} try {
System.out.println(Arrays.toString(getFrameLocation(t, count)));
} catch (RuntimeException e) {
System.out.println(e.getMessage());
}
// Let the thread make progress and die. synchronized(data.waitFor) {
data.waitFor.notifyAll();
}
t.join();
}
publicstaticvoid doTestOtherThreadBusyLoop() throws Exception {
System.out.println("###########################");
System.out.println("### Other thread (live) ###");
System.out.println("###########################"); final ControlData data = new ControlData(); Thread t = newThread("Frames doTestOtherThreadBusyLoop") { publicvoid run() {
Recurse.foo(4, 0, 0, data);
}
};
t.start();
data.reached.await(); Thread.yield(); Thread.sleep(500); // A little bit of time...
int count = getFrameCount(t);
System.out.println(count); try {
System.out.println(Arrays.toString(getFrameLocation(t, -1)));
} catch (RuntimeException e) {
System.out.println(e.getMessage());
} for (int i = 0; i < count; i++) {
System.out.println(Arrays.toString(getFrameLocation(t, i)));
} try {
System.out.println(Arrays.toString(getFrameLocation(t, count)));
} catch (RuntimeException e) {
System.out.println(e.getMessage());
}
// Let the thread stop looping and die.
data.stop = true;
t.join();
}
publicstaticnativeint getFrameCount(Threadthread); publicstaticnative Object[] getFrameLocation(Threadthread, int depth);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.