ADTast-experimental
Last change
on this file since c8238c0 was
b183717,
checked in by Andrew Beach <ajbeach@…>, 3 years ago
|
Update another file in the exception benchmarks as well as some print formatting.
|
-
Property mode set to
100755
|
File size:
567 bytes
|
Rev | Line | |
---|
[63e3ed8] | 1 | #!/usr/bin/env python3 |
---|
| 2 | |
---|
| 3 | # Cross a Try Statement with a Termination Handler |
---|
| 4 | |
---|
| 5 | from time import thread_time_ns |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | class NotRaisedException(Exception): |
---|
| 9 | pass |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | def main(argv): |
---|
| 13 | times = 1; |
---|
| 14 | if 1 < len(argv): |
---|
| 15 | times = int(argv[1]) |
---|
| 16 | |
---|
| 17 | start_time = thread_time_ns() |
---|
| 18 | for count in range(times): |
---|
| 19 | try: |
---|
| 20 | pass |
---|
| 21 | except NotRaisedException: |
---|
| 22 | pass |
---|
| 23 | |
---|
| 24 | end_time = thread_time_ns() |
---|
[b183717] | 25 | print('Run-Time (s): {:.1f}'.format((end_time - start_time) / 1_000_000_000.)) |
---|
[63e3ed8] | 26 | |
---|
| 27 | |
---|
| 28 | if '__main__' == __name__: |
---|
| 29 | import sys |
---|
| 30 | main(sys.argv) |
---|
Note: See
TracBrowser
for help on using the repository browser.