Skip to content

Commit fbd6ab9

Browse files
authored
SIGNIFICANTLY REDUCED CPU USAGE
1 parent 7d5617b commit fbd6ab9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CloudServer/UI/StrmServer.jar

111 Bytes
Binary file not shown.

CloudServer/UI/StrmServer.tar.gz

359 Bytes
Binary file not shown.

CloudServer/UI/StrmServerUI.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* This is the UI class for Strm Server
44
*
55
* @author Will Ritchie
6-
* @version 1.0.1
6+
* @version 1.0.2
77
*/
88

99
import javax.swing.ImageIcon;
@@ -27,9 +27,11 @@ public class StrmServerUI
2727
final private static String LOG_FILE= "etc"+File.separator+"log.cfg";
2828
private static String cloudPath= "docs"+File.separator;
2929

30+
final private static int PASSIVE_TIMEOUT= 50; //The timeout time to wait between mouse presses, keystrokes, etc...
31+
3032
final public static int WIDTH= 500;
3133
final public static int HEIGHT= 500;
32-
final private static String TITLE= "Strm Server Control Panel beta-1.0.1";
34+
final private static String TITLE= "Strm Server Control Panel beta-1.0.2";
3335
final private static String ICON_NAME= "graphics"+File.separator+"cloud-icon.png";
3436

3537
final private static Font MAIN_MSG_FONT= new Font("Arial Black",Font.BOLD, WIDTH/25);
@@ -90,6 +92,14 @@ public static void main(String[] args){
9092

9193
//Start the listener code:
9294
while(ui.exists()){
95+
try{
96+
Thread.sleep(PASSIVE_TIMEOUT);
97+
}
98+
catch(InterruptedException e){
99+
System.err.println("Error in sleeping");
100+
e.printStackTrace();
101+
}
102+
93103
if(ui.isMousePressed()){
94104
double mouseX= ui.mouseX();
95105
double mouseY= ui.mouseY();

0 commit comments

Comments
 (0)