Changeset c86ee4c for doc/theses/andrew_beach_MMath/code/CondCatch.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 moved
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/CondCatch.java
r1f45c7d rc86ee4c 3 3 class EmptyException extends Exception {} 4 4 5 public class Cond Match {5 public class CondCatch { 6 6 static boolean should_catch = false; 7 7 … … 20 20 } 21 21 22 public static void main(String[] args) { 23 int times = 1; 24 int total_frames = 1; 25 if (0 < args.length) { 26 times = Integer.parseInt(args[0]); 27 } 28 if (1 < args.length) { 29 total_frames = Integer.parseInt(args[1]); 30 } 31 22 private static long loop(int times) { 23 long startTime = System.nanoTime(); 32 24 for (int count = 0 ; count < times ; ++count) { 33 25 try { … … 37 29 } 38 30 } 31 long endTime = System.nanoTime(); 32 return endTime - startTime; 33 } 34 35 public static void main(String[] args) { 36 int times = 1; 37 if (0 < args.length) { 38 times = Integer.parseInt(args[0]); 39 } 40 if (1 < args.length) { 41 should_catch = 0 != Integer.parseInt(args[1]); 42 } 43 44 // Warm-Up: 45 loop(1000); 46 47 long time = loop(times); 48 System.out.println("Run-Time (ns): " + time); 39 49 } 40 50 }
Note:
See TracChangeset
for help on using the changeset viewer.