Created
September 13, 2011 11:21
-
-
Save joshz/1213620 to your computer and use it in GitHub Desktop.
split/map/pass to func simple test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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