Skip to content

Commit 957c89a

Browse files
Michael BalasMichael Balas
authored andcommitted
Update Comment for Thread.sleep()
This commit describes why the thread is delayed by two milliseconds, "prevents the loop from using too much CPU".
1 parent a3d364d commit 957c89a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/com/redomar/game/Game.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public void run() {
408408
}
409409

410410
try {
411-
Thread.sleep(2); // Delays the thread by 2 milliseconds
411+
Thread.sleep(2); // Delays the thread by 2 milliseconds - prevents the loop from using too much CPU
412412
} catch (InterruptedException e) { // If the current thread is interrupted, the interrupted status is cleared
413413
e.printStackTrace();
414414
}

0 commit comments

Comments
 (0)