package com.sf.utils.thread; import com.sf.utils.HttpUtils; public class TestRunnable1 { public static void main(String[] args) { String url = "http://localhost:8080/seckill?userId=111&goodsId=1"; for (int i = 0; i < 20; i++) { Thread thread = new Thread(new Runnable() { @Override public void run() { try { HttpUtils.seckill(url); } catch (Exception e) { throw new RuntimeException(e); } } }); thread.start(); } } }