ADT
arm-eh
ast-experimental
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
pthread-emulation
qualifiedEnum
|
Last change
on this file since f46bfd2f was bf71cfd, checked in by Thierry Delisle <tdelisle@…>, 7 years ago |
|
Moved up many directories in source
|
-
Property mode
set to
100644
|
|
File size:
462 bytes
|
| Line | |
|---|
| 1 | public class JavaThread {
|
|---|
| 2 | public static class MyThread extends Thread {
|
|---|
| 3 | @Override
|
|---|
| 4 | public void run() {}
|
|---|
| 5 | }
|
|---|
| 6 |
|
|---|
| 7 | public static void main(String[] args) throws InterruptedException {
|
|---|
| 8 | int NoOfTimes = 50000;
|
|---|
| 9 | long start = System.nanoTime();
|
|---|
| 10 | for(int i = 1; i <= NoOfTimes; i += 1) {
|
|---|
| 11 | JavaThread.MyThread m = new JavaThread.MyThread();
|
|---|
| 12 | m.start();
|
|---|
| 13 | m.join();
|
|---|
| 14 | }
|
|---|
| 15 | long end = System.nanoTime();
|
|---|
| 16 | System.out.println( (end - start) / NoOfTimes);
|
|---|
| 17 | }
|
|---|
| 18 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.