Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/CrossFinally.java

    rea593a3 r11d4fa5  
    22
    33public 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;
    105
     6        private static long loop(int times) {
     7                long startTime = System.nanoTime();
    118                for (int count = 0 ; count < times ; ++count) {
    129                        try {
     
    1613                        }
    1714                }
     15                long endTime = System.nanoTime();
     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);
    1830        }
    1931}
Note: See TracChangeset for help on using the changeset viewer.