source: doc/theses/andrew_beach_MMath/code/try-finally.py @ f79ee0d

ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationpthread-emulationqualifiedEnum
Last change on this file since f79ee0d was f79ee0d, checked in by Peter A. Buhr <pabuhr@…>, 3 years ago

update exception benchmarks

  • Property mode set to 100755
File size: 574 bytes
Line 
1#!/usr/bin/env python3
2
3# Cross a Try Statement With Finally Clause
4
5from time import thread_time_ns
6
7
8def main(argv):
9    times = 1;
10    total_frames = 1;
11    if 1 < len(argv):
12        times = int(argv[1])
13    if 2 < len(argv):
14        total_frames = int(argv[2])
15
16    start_time = thread_time_ns()
17    for count in range(times):
18        try:
19            pass
20        finally:
21            pass
22
23    end_time = thread_time_ns()
24    print('Run-Time (s) {:.1f}:'.format((end_time - start_time) / 1_000_000_000.))
25
26
27if '__main__' == __name__:
28    import sys
29    main(sys.argv)
Note: See TracBrowser for help on using the repository browser.