Changeset 11d4fa5 for doc/theses/andrew_beach_MMath/code/CrossCatch.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/CrossCatch.java
racb38ce9 r11d4fa5 4 4 5 5 public class CrossCatch { 6 public static void main(String[] args) { 7 int times = 1; 8 boolean shouldThrow = false; 9 if (0 < args.length) { 10 times = Integer.parseInt(args[0]); 11 } 6 private static boolean shouldThrow = false; 12 7 8 private static long loop(int times) { 13 9 long startTime = System.nanoTime(); 14 10 for (int count = 0 ; count < times ; ++count) { … … 22 18 } 23 19 long endTime = System.nanoTime(); 24 System.out.println("Run-Time (ns) " + (endTime - startTime)); 20 return endTime - startTime; 21 } 22 23 public static void main(String[] args) { 24 int times = 1; 25 if (0 < args.length) { 26 times = Integer.parseInt(args[0]); 27 } 28 29 // Warm-Up: 30 loop(1000); 31 32 long time = loop(times); 33 System.out.println("Run-Time (ns): " + time); 25 34 } 26 35 }
Note: See TracChangeset
for help on using the changeset viewer.