Commit 7a0b4ff3 authored by wurongjun's avatar wurongjun

测试cpu损耗过高

parent 36068fa5
...@@ -10,28 +10,33 @@ public class Application { ...@@ -10,28 +10,33 @@ public class Application {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication sa = new SpringApplication(Application.class); // SpringApplication sa = new SpringApplication(Application.class);
sa.run(args); // sa.run(args);
//
java.lang.Thread t=new java.lang.Thread(new Runnable() { // java.lang.Thread t=new java.lang.Thread(new Runnable() {
@Override // @Override
public void run() { // public void run() {
//
try { // try {
while(true) { // while(true) {
log.info("log test,time:{}", System.currentTimeMillis()); // log.info("log test,time:{}", System.currentTimeMillis());
Thread.sleep(10000); // Thread.sleep(10000);
} // }
} catch (InterruptedException e) { // } catch (InterruptedException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
//
} // }
}); // });
t.run(); // t.run();
int num = 0;
while (true) { while (true) {
num = num + 1;
if (num == Integer.MAX_VALUE) {
num = 0;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment