Ignore:
Timestamp:
Sep 9, 2021, 3:56:32 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
d0b9247
Parents:
dd1cc02 (diff), d8d512e (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/cond-catch.py

    rdd1cc02 r5a40e4e  
    1313
    1414
    15 def throw_exception():
    16     raise EmptyException()
    17 
    18 
    19 def cond_catch():
    20     try:
    21         throw_exception()
    22     except EmptyException as exc:
    23         if not should_catch:
    24             raise
    25 
    26 
    2715def main(argv):
    2816    times = 1
     
    3523    for count in range(times):
    3624        try:
    37             cond_catch();
     25            try:
     26                raise EmptyException()
     27            except EmptyException as exc:
     28                if not should_catch:
     29                    raise
    3830        except EmptyException:
    3931            pass
    4032
    4133    end_time = thread_time_ns()
    42     print('Run-Time (ns):', end_time - start_time)
     34    print('Run-Time (s): {:.1f}'.format((end_time - start_time) / 1_000_000_000.))
    4335
    4436
Note: See TracChangeset for help on using the changeset viewer.