Skip to content

Instantly share code, notes, and snippets.

@joshz
Created September 13, 2011 11:21
Show Gist options
  • Select an option

  • Save joshz/1213620 to your computer and use it in GitHub Desktop.

Select an option

Save joshz/1213620 to your computer and use it in GitHub Desktop.
split/map/pass to func simple test
def f(m, n, t, p):
pass
if __name__ == "__main__":
import time
for j in range(5):
start1 = time.clock()
for i in range(2000000):
data = "100 10 2 1".split()
f(*map(int, data))
end1 = time.clock() - start1
start2 = time.clock()
for i in range(2000000):
(m, n, t, p) = [int(i) for i in "100 10 2 1".split()]
f(m, n, t, p)
end2 = time.clock() - start2
q = (end1)/(end2)
d = abs(end1 - end2)
print end1, end2, q,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment