Skip to content

Instantly share code, notes, and snippets.

@scottstanfield
Created January 13, 2019 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottstanfield/c2bf0f9f8c3bc85ba5f0c87b2d0baad4 to your computer and use it in GitHub Desktop.
Save scottstanfield/c2bf0f9f8c3bc85ba5f0c87b2d0baad4 to your computer and use it in GitHub Desktop.
import numpy as np
import time
N = 102400
x = np.linspace(0.0123, 4567.89, N)
def mine(x,Z,func,name):
print(name)
start = time.time()
for z in range ( 0, Z ) :
y = func(x);
end = time.time()
print(N, Z, end - start)
return
mine(x,10000,np.sin,'np.sin')
mine(x,10000,np.cos,'np.cos')
mine(x,10000,np.tan,'np.tan')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment