Skip to content

Commit 3b3dd5e

Browse files
commented out the @Profile
1 parent 0398a9a commit 3b3dd5e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

week-08/code/timing.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
timing example
55
"""
66

7-
@profile
7+
# @profile
88
def primes_stupid(N):
99
"""
1010
a really simple way to compute the first N prime numbers
@@ -22,14 +22,14 @@ def primes_stupid(N):
2222
return primes
2323

2424
if __name__ == "__main__":
25-
# import timeit
25+
import timeit
2626

2727

28-
# print "running the timer on primes_stupid:"
29-
# run_time = timeit.timeit("primes_stupid(100)",
30-
# setup="from __main__ import primes_stupid",
31-
# number=500) # default: 1000000
32-
# print "it took: %f seconds"%run_time
28+
print "running the timer on primes_stupid:"
29+
run_time = timeit.timeit("primes_stupid(100)",
30+
setup="from __main__ import primes_stupid",
31+
number=500) # default: 1000000
32+
print "it took: %f seconds"%run_time
3333
primes_stupid(100)
3434

3535

0 commit comments

Comments
 (0)