diff --git a/src/chapter5/Example11.java b/src/chapter5/Example11.java new file mode 100644 index 0000000..e95df25 --- /dev/null +++ b/src/chapter5/Example11.java @@ -0,0 +1,14 @@ +package chapter5; + +public class Example11 { + public static void main(String[] args) { + long startTime = System.currentTimeMillis(); + String test = ""; + for (int i = 0; i < 100000; i ++) { + test += "test"; + } + + long endTime = System.currentTimeMillis(); + System.out.println("程序运行的时间:" + (endTime - startTime) + "ms"); + } +}