package com.example.demo.research.async;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.*;
import java.util.function.Supplier;
public class CompletableFutureDemo {
/**
* CPU核数
*/
private static final int AVAILABLE_PROCESSORS = Runtime.getRuntime().availableProcessors();
private static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(AVAILABLE_PROCESSORS,
3 * AVAILABLE_PROCESSORS,
3, TimeUnit.SECONDS,
new LinkedBlockingDeque<>(20));
public static void main(String[] args) throws Exception {
long startTime = System.currentTimeMillis();
System.out.println("demo start....." + startTime);
demo3();
System.out.println("demo end.....costTime