Changeset c86ee4c for doc/theses/andrew_beach_MMath/code/CrossFinally.java
- Timestamp:
- Jul 7, 2021, 6:24:42 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d83b266
- Parents:
- 1f45c7d (diff), b1a2c4a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/CrossFinally.java
r1f45c7d rc86ee4c 2 2 3 3 public class CrossFinally { 4 public static void main(String[] args) { 5 int times = 1; 6 boolean shouldThrow = false; 7 if (0 < args.length) { 8 times = Integer.parseInt(args[0]); 9 } 4 private static boolean shouldThrow = false; 10 5 6 private static long loop(int times) { 7 long startTime = System.nanoTime(); 11 8 for (int count = 0 ; count < times ; ++count) { 12 9 try { … … 16 13 } 17 14 } 15 long endTime = System.nanoTime(); 16 return endTime - startTime; 17 } 18 19 public static void main(String[] args) { 20 int times = 1; 21 if (0 < args.length) { 22 times = Integer.parseInt(args[0]); 23 } 24 25 // Warm-Up: 26 loop(1000); 27 28 long time = loop(times); 29 System.out.println("Run-Time (ns): " + time); 18 30 } 19 31 }
Note:
See TracChangeset
for help on using the changeset viewer.