Changeset 11d4fa5 for doc/theses/andrew_beach_MMath/code/ThrowOther.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/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.