Mercurial > op > Looping
view Looping.py @ 1:9d6fb29e41ce
Objective-C IMPのベンチマークが抜けていたため、追加。
author | "uncorrelated zombie" <uncorrelated@yahoo.co.jp> |
---|---|
date | Tue, 15 Feb 2011 18:38:19 +0900 |
parents | 2216535ade9c |
children | 57283e4fdd4b |
line wrap: on
line source
#!/usr/bin/env python import time class Looping: "Looping Class" n0 = 0 def calc(self, n): n1 = self.n0 + (2 - 2*(n%2)); self.n0 = n; return n1 if __name__ == "__main__": s = Looping() c = 0 n = 1 t1 = time.time() while c<2147483647: n = s.calc(n) c = c + 1 t2 = time.time() print n, "Python\t", (t2 - t1)