Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added timing statments

  • Loading branch information...
commit 8923fc64d672b806d2431e340595621e0e598550 1 parent 91984ca
@amal-ghamdi amal-ghamdi authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 apps/shallow/2d/shallow2D.py
View
14 apps/shallow/2d/shallow2D.py
@@ -33,6 +33,7 @@ def shallow2D(use_petsc=False,iplot=0,htmlplot=False,outdir='./_output',solver_t
if use_petsc:
import petclaw as pyclaw
+ print "yes"
else:
import pyclaw
@@ -114,13 +115,24 @@ def shallow2D(use_petsc=False,iplot=0,htmlplot=False,outdir='./_output',solver_t
if __name__=="__main__":
import sys
+ from time import time
if len(sys.argv)>1:
from pyclaw.util import _info_from_argv
args, kwargs = _info_from_argv(sys.argv)
+ t1= time()
+ error=shallow2D(*args,**kwargs)
+ t2 = time()
error=shallow2D(*args,**kwargs)
print 'Error: ',error
- else: shallow2D()
+ else:
+ t1 = time()
+ shallow2D()
+ t2 = time()
+ shallow2D()
+ t3 = time()
+ print "first call", t2-t1, "second call", t3-t2
+
Please sign in to comment.
Something went wrong with that request. Please try again.