source: benchmark/creation/python_cor.py @ 5fd5de2

ADTast-experimental
Last change on this file since 5fd5de2 was c12869e, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

update benchmarks for concurrency paper

  • Property mode set to 100644
File size: 380 bytes
Line 
1import sys
2import time
3
4times = 50000000
5argc = len( sys.argv )
6if argc > 2:
7        sys.exit( 1 )
8if argc == 2:
9        times = int( sys.argv[1] )
10
11def C():
12        yield
13
14start = time.time_ns()
15for i in range( 10000000 ):
16        c = C()
17        next( c )  # resume
18end = time.time_ns()
19print( (end - start) / times )
20
21# Local Variables: #
22# tab-width: 4 #
23# compile-command: "python3.7 python_cor.py" #
24# End: #
Note: See TracBrowser for help on using the repository browser.