Skip to content

Commit a5ab2af

Browse files
committed
GuiUtils#sleep for easier sleeping
Rest easy my friend
1 parent 3bb7d97 commit a5ab2af

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/main/java/club/bytecode/the/jda/JDA.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,7 @@ private static void onExit() {
194194
*/
195195
public static void waitForTasks() {
196196
while (jobCount.get() > 0) {
197-
try {
198-
Thread.sleep(10L);
199-
} catch (InterruptedException e) {
200-
e.printStackTrace();
201-
}
197+
GuiUtils.sleep(10L);
202198
}
203199
}
204200

src/main/java/club/bytecode/the/jda/util/GuiUtils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,12 @@ public static void setLookAndFeel() {
4848
}
4949
}
5050
}
51+
52+
public static void sleep(long millis) {
53+
try {
54+
Thread.sleep(millis);
55+
} catch(InterruptedException e) {
56+
e.printStackTrace();
57+
}
58+
}
5159
}

0 commit comments

Comments
 (0)