开启多线程执行

public static void main(String[] args) throws Exception {
        for (int i = 0; i < 500; i++) {
        startThread();
           
         }
}
public static void startThread() {
       new Thread() {
           public void run() {
          
               System.out.println(this.currentThread().getName()+"开始时间[" + System.currentTimeMillis());
               try {
moderationImageDemo();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
   
               System.out.println(this.currentThread().getName()+"结束时间[" + System.currentTimeMillis());
           }
       }.start();
   }

猜你喜欢

转载自blog.csdn.net/guorun18/article/details/79761197