Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test implements Runnable {
- public static void main(String[] d) {
- final int THREADCOUNT=100;
- Test[] t = new Test[THREADCOUNT];
- Thread[] th = new Thread[THREADCOUNT];
- for (int index = 0; index < THREADCOUNT; index++) {
- t[index]=new Test();
- th[index] = new Thread(t[index]);
- th[index].start();
- }
- }
- public void run() {
- int z = 0;
- for (long counter = 0; counter < 1000000000L; counter++) {
- z++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment