线程助手ThreadUtil
1.执行.
方法
Description
1.1 void execute(List list,int eachSize,Map<String, ?> paramsMap,PartitionRunnableBuilder partitionRunnableBuilder)
public void testExecuteTest() throws InterruptedException{
Date beginDate = new Date();
List<Integer> list = toList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
for (Integer integer : list){
//------
//模拟 do something
//---------
Thread.sleep(1 * MILLISECOND_PER_SECONDS);
}
LOGGER.info("use time:{}", formatDuration(beginDate));
}2.创建指定数量 threadCount 的线程,并执行
方法
Description
2.1 void execute(Runnable runnable,int threadCount)
最后更新于
这有帮助吗?
