import java.util.concurrent.CountDownLatch;
public class TextTimeMinutesOfDemo {
public static void main(String[] args) throws Exception{
long start = System.currentTimeMillis();
int threadCount = 10;
final CountDownLatch countDownLatch = new CountDownLatch(threadCount);
for (int i = 0;i<threadCount;i++){
new Thread(new Runnable() {
@Override
public void run() {
for (int i=0;i<1000000;i++){
Object o = SingletonDemo01.getInstance();
}
countDownLatch.countDown();
}
}).start();
}
countDownLatch.await();
long end = System.currentTimeMillis();
System.out.println("运行时间为:"+(end-start));
}
}