Changeset 5a40e4e for doc/theses/andrew_beach_MMath/code/cond-catch.py
- Timestamp:
- Sep 9, 2021, 3:56:32 PM (4 years ago)
- 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. - File:
-
- 1 moved
-
doc/theses/andrew_beach_MMath/code/cond-catch.py (moved) (moved from doc/theses/andrew_beach_MMath/code/cond_catch.py ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/cond-catch.py
rdd1cc02 r5a40e4e 13 13 14 14 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 raise25 26 27 15 def main(argv): 28 16 times = 1 … … 35 23 for count in range(times): 36 24 try: 37 cond_catch(); 25 try: 26 raise EmptyException() 27 except EmptyException as exc: 28 if not should_catch: 29 raise 38 30 except EmptyException: 39 31 pass 40 32 41 33 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.)) 43 35 44 36
Note:
See TracChangeset
for help on using the changeset viewer.