File tree 1 file changed +10
-12
lines changed
Filter options
1 file changed +10
-12
lines changed
Original file line number Diff line number Diff line change @@ -168,25 +168,23 @@ What's the difference in speed? Let's try it!
168
168
.. code-block :: python
169
169
170
170
import time
171
- # activate pyx compiler
171
+ # Activate pyx compiler
172
172
import pyximport
173
- pyximport.install()
174
- # primes implemented with Cython
175
- import primesCy
176
- # primes implemented with Python
177
- import primes
173
+ pyximport.install()
174
+ import primesCy # primes implemented with Cython
175
+ import primes # primes implemented with Python
178
176
179
177
print (" Cython:" )
180
- t1= time.time()
178
+ t1 = time.time()
181
179
print (primesCy.primes(500 ))
182
- t2= time.time()
183
- print (" Cython time: %s " % (t2- t1))
180
+ t2 = time.time()
181
+ print (" Cython time: %s " % (t2 - t1))
184
182
print (" " )
185
183
print (" Python" )
186
- t1= time.time()
184
+ t1 = time.time()
187
185
print (primes.primes(500 ))
188
- t2= time.time()
189
- print (" Python time: %s " % (t2- t1))
186
+ t2 = time.time()
187
+ print (" Python time: %s " % (t2 - t1))
190
188
191
189
192
190
These lines both need a remark:
You can’t perform that action at this time.
0 commit comments