@RequestMapping("/asyncTest")publicStringasyncTest(){try{StopWatch stopWatch =newStopWatch();
stopWatch.start();CompletableFuture<Long> one = asyncService.executeAsync1();CompletableFuture<Long> two = asyncService.executeAsync2();CompletableFuture<Long> three = asyncService.executeAsync3();CompletableFuture<Long> four = asyncService.executeAsync4();CompletableFuture<Long> five = asyncService.executeAsync5();CompletableFuture.allOf(one,two,three,four,five);System.out.println(five.get());
stopWatch.stop();double totalTimeSeconds = stopWatch.getTotalTimeSeconds();System.out.println("cost:"+totalTimeSeconds);System.out.println("get:"+five.get());return"success";}catch(Exception e){return"error";}}