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

ADT ast-experimental enum forall-pointer-decay jacob/cs343-translation pthread-emulation qualifiedEnum
Last change on this file since fe8aa21 was f79ee0d, checked in by Peter A. Buhr <pabuhr@…>, 4 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.