Changeset 11d4fa5 for doc/theses
- Timestamp:
- Jul 7, 2021, 11:56:29 AM (4 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
- Location:
- doc/theses/andrew_beach_MMath/code
- Files:
-
- 6 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 } -
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 } -
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 } -
doc/theses/andrew_beach_MMath/code/ThrowEmpty.java
racb38ce9 r11d4fa5 12 12 } 13 13 14 private static long loop(int times, int total_frames) { 15 long startTime = System.nanoTime(); 16 for (int count = 0 ; count < times ; ++count) { 17 try { 18 unwind_empty(total_frames); 19 } catch (EmptyException e) { 20 // ... 21 } 22 } 23 long endTime = System.nanoTime(); 24 return endTime - startTime; 25 } 26 14 27 public static void main(String[] args) { 15 28 int times = 1; … … 22 35 } 23 36 24 long startTime = System.nanoTime(); 25 for (int count = 0 ; count < times ; ++count) { 26 try { 27 unwind_empty(total_frames); 28 } catch (EmptyException e) { 29 // ... 30 } 31 } 32 long endTime = System.nanoTime(); 33 System.out.println("Run-Time (ns) " + (endTime - startTime)); 37 // Warm-Up: 38 loop(1000, total_frames); 39 40 long time = loop(times, total_frames); 41 System.out.println("Run-Time (ns): " + time); 34 42 } 35 43 } -
doc/theses/andrew_beach_MMath/code/ThrowFinally.java
racb38ce9 r11d4fa5 13 13 } 14 14 15 private static long loop(int times, int total_frames) { 16 long startTime = System.nanoTime(); 17 for (int count = 0 ; count < times ; ++count) { 18 try { 19 unwind_finally(total_frames); 20 } catch (EmptyException e) { 21 // ... 22 } 23 } 24 long endTime = System.nanoTime(); 25 return endTime - startTime; 26 } 27 15 28 public static void main(String[] args) { 16 29 int times = 1; … … 23 36 } 24 37 25 long startTime = System.nanoTime(); 26 for (int count = 0 ; count < times ; ++count) { 27 try { 28 unwind_finally(total_frames); 29 } catch (EmptyException e) { 30 // ... 31 } 32 } 33 long endTime = System.nanoTime(); 34 System.out.println("Run-Time (ns) " + (endTime - startTime)); 38 // Warm-Up: 39 loop(1000, total_frames); 40 41 long time = loop(times, total_frames); 42 System.out.println("Run-Time (ns): " + time); 35 43 } 36 44 } -
doc/theses/andrew_beach_MMath/code/ThrowOther.java
racb38ce9 r11d4fa5 24 24 } 25 25 26 public static void main(String[] args) { 27 int times = 1; 28 int total_frames = 1; 29 if (0 < args.length) { 30 times = Integer.parseInt(args[0]); 31 } 32 if (1 < args.length) { 33 total_frames = Integer.parseInt(args[1]); 34 } 35 26 private static long loop(int times, int total_frames) { 36 27 long startTime = System.nanoTime(); 37 28 for (int count = 0 ; count < times ; ++count) { … … 45 36 } 46 37 long endTime = System.nanoTime(); 47 System.out.println("Run-Time (ns) " + (endTime - startTime)); 38 return endTime - startTime; 39 } 40 41 public static void main(String[] args) { 42 int times = 1; 43 int total_frames = 1; 44 if (0 < args.length) { 45 times = Integer.parseInt(args[0]); 46 } 47 if (1 < args.length) { 48 total_frames = Integer.parseInt(args[1]); 49 } 50 51 // Warm-Up: 52 loop(1000, total_frames); 53 54 long time = loop(times, total_frames); 55 System.out.println("Run-Time (ns): " + time); 48 56 } 49 57 }
Note: See TracChangeset
for help on using the changeset viewer.