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 moved

Legend:

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

    r1f45c7d rc86ee4c  
    33class EmptyException extends Exception {}
    44
    5 public class CondMatch {
     5public class CondCatch {
    66        static boolean should_catch = false;
    77
     
    2020        }
    2121
    22         public static void main(String[] args) {
    23                 int times = 1;
    24                 int total_frames = 1;
    25                 if (0 < args.length) {
    26                         times = Integer.parseInt(args[0]);
    27                 }
    28                 if (1 < args.length) {
    29                         total_frames = Integer.parseInt(args[1]);
    30                 }
    31 
     22        private static long loop(int times) {
     23                long startTime = System.nanoTime();
    3224                for (int count = 0 ; count < times ; ++count) {
    3325                        try {
     
    3729                        }
    3830                }
     31                long endTime = System.nanoTime();
     32                return endTime - startTime;
     33        }
     34
     35        public static void main(String[] args) {
     36                int times = 1;
     37                if (0 < args.length) {
     38                        times = Integer.parseInt(args[0]);
     39                }
     40                if (1 < args.length) {
     41                        should_catch = 0 != Integer.parseInt(args[1]);
     42                }
     43
     44                // Warm-Up:
     45                loop(1000);
     46
     47                long time = loop(times);
     48                System.out.println("Run-Time (ns): " + time);
    3949        }
    4050}
Note: See TracChangeset for help on using the changeset viewer.