Browse Source

Updates script to show calculation time.

Ovidio Peña Rodríguez 9 years ago
parent
commit
2d36922726
1 changed files with 6 additions and 0 deletions
  1. 6 0
      examples/field-nanoshell.py

+ 6 - 0
examples/field-nanoshell.py

@@ -35,6 +35,7 @@
 
 from scattnlay import fieldnlay
 import numpy as np
+import time
 
 n1 = 1.53413
 n2 = 0.565838 + 7.23262j
@@ -62,8 +63,13 @@ coordZ = np.zeros(npts*npts, dtype = np.float64)
 
 coord = np.vstack((coordX, coordY, coordZ)).transpose()
 
+start_time = time.time()
+
 terms, E, H = fieldnlay(x, m, coord)
 
+elapsed_time = time.time() - start_time
+print "Time: ", elapsed_time
+
 Er = np.absolute(E)
 
 # |E|/|Eo|