Changeset 11d4fa5 for doc/theses/andrew_beach_MMath/code/CondCatch.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/CondCatch.java
racb38ce9 r11d4fa5 20 20 } 21 21 22 private static long loop(int times) { 23 long startTime = System.nanoTime(); 24 for (int count = 0 ; count < times ; ++count) { 25 try { 26 cond_catch(); 27 } catch (EmptyException exc) { 28 // ... 29 } 30 } 31 long endTime = System.nanoTime(); 32 return endTime - startTime; 33 } 34 22 35 public static void main(String[] args) { 23 36 int times = 1; … … 29 42 } 30 43 31 long startTime = System.nanoTime(); 32 for (int count = 0 ; count < times ; ++count) { 33 try { 34 cond_catch(); 35 } catch (EmptyException exc) { 36 // ... 37 } 38 } 39 long endTime = System.nanoTime(); 40 System.out.println("Run-Time (ns) " + (endTime - startTime)); 44 // Warm-Up: 45 loop(1000); 46 47 long time = loop(times); 48 System.out.println("Run-Time (ns): " + time); 41 49 } 42 50 }
Note: See TracChangeset
for help on using the changeset viewer.