Changeset 11d4fa5 for doc/theses/andrew_beach_MMath/code/CrossFinally.java
- Timestamp:
- Jul 7, 2021, 11:56:29 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 47e413b
- Parents:
- acb38ce9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/CrossFinally.java
racb38ce9 r11d4fa5 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) { 11 7 long startTime = System.nanoTime(); 12 8 for (int count = 0 ; count < times ; ++count) { … … 18 14 } 19 15 long endTime = System.nanoTime(); 20 System.out.println("Run-Time (ns) " + (endTime - startTime)); 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); 21 30 } 22 31 }
Note: See TracChangeset
for help on using the changeset viewer.