File tree 1 file changed +16
-18
lines changed
1 file changed +16
-18
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
178
-
179
- print " Cython:"
180
8000
- t1= time.time()
181
- print primesCy.primes(500 )
182
- t2= time.time()
183
- print " Cython time: %s " % (t2- t1)
184
- print " "
185
- print " Python"
186
- t1= time.time()
187
- print primes.primes(500 )
188
- t2= time.time()
189
- print " Python time: %s " % (t2- t1)
173
+ pyximport.install()
174
+ import primesCy # primes implemented with Cython
175
+ import primes # primes implemented with Python
176
+
177
+ print (" Cython:" )
178
+ t1 = time.time()
179
+ print (primesCy.primes(500 ))
180
+ t2 = time.time()
181
+ print (" Cython time: %s " % (t2 - t1))
182
+ print (" " )
183
+ print (" Python" )
184
+ t1 = time.time()
185
+ print (primes.primes(500 ))
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