source: doc/theses/andrew_beach_MMath/code/cross_finally.py@ d83b266

ADT ast-experimental enum forall-pointer-decay jacob/cs343-translation new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since d83b266 was 63e3ed8, checked in by Andrew Beach <ajbeach@…>, 4 years ago

Added Python versions of the exception benchmarks.

  • Property mode set to 100755
File size: 542 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 (ns):', end_time - start_time)
25
26
27if '__main__' == __name__:
28 import sys
29 main(sys.argv)
Note: See TracBrowser for help on using the repository browser.