Ignore:
Timestamp:
Jul 7, 2021, 6:24:42 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r1f45c7d rc86ee4c  
    44
    55public 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;
    127
     8        private static long loop(int times) {
     9                long startTime = System.nanoTime();
    1310                for (int count = 0 ; count < times ; ++count) {
    1411                        try {
     
    2017                        }
    2118                }
     19                long endTime = System.nanoTime();
     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);
    2234        }
    2335}
Note: See TracChangeset for help on using the changeset viewer.