Skip to content

Commit

Permalink
Update java8-tutorial-translate.md
Browse files Browse the repository at this point in the history
在举例Stream中,Parallel Sort(并行排序)时,列举并行排序的例子里面,代码中的注释写成了“//串行排序所用的时间”。但其实是“//并行排序所用的时间”
  • Loading branch information
SteamBoatv authored Jul 11, 2024
1 parent a88ad33 commit d077fdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/java/new-features/java8-tutorial-translate.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ System.out.println(String.format("parallel sort took: %d ms", millis));

```java
1000000
parallel sort took: 475 ms//串行排序所用的时间
parallel sort took: 475 ms//并行排序所用的时间
```

上面两个代码几乎是一样的,但是并行版的快了 50% 左右,唯一需要做的改动就是将 `stream()` 改为`parallelStream()`。
Expand Down

0 comments on commit d077fdf

Please sign in to comment.