Skip to content

Instantly share code, notes, and snippets.

@NickCody

NickCody/Busy.java

Created Jan 8, 2020
Embed
What would you like to do?
Simple Java program to saturate CPU's
package com.primordia.monba.test;
public class Busy {
public static void main(String[] args) {
for (int i = 0; i < 40; i++) {
Runnable runnable = () -> {
Thread t = Thread.currentThread();
long l =0;
while(true) {
l++;
}
};
Thread t = new Thread(runnable);
t.start();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.