Skip to content

Commit

Permalink
Add a timer
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Jun 23, 2011
1 parent 0b7a43c commit 26a8e06
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions laplace_py.py
@@ -1,5 +1,6 @@
from numpy import zeros
from scipy import weave
from timeit import default_timer as clock

dx = 0.1
dy = 0.1
Expand All @@ -19,3 +20,12 @@ def calc(N, Niter=100, func=py_update, args=()):
for i in range(Niter):
func(u,*args)
return u

if __name__ == "__main__":
t = clock()
u = calc(100, 8000)
t = clock() - t
print t
print u[1, 1]
print sum(u.flat)
print sum((u**2).flat)

0 comments on commit 26a8e06

Please sign in to comment.