Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import time
- class Timer:
- def start(self):
- self.starttime = time()
- def stop(self):
- print(time()-self.starttime)
- def fat_catenate():
- s = ''
- for i in range(3000000):
- s += 'a'
- def listomania():
- l = []
- for i in range(3000000):
- l.append('a')
- ''.join(l)
- t1 = Timer()
- t2 = Timer()
- t1.start()
- fat_catenate()
- t1.stop()
- t2.start()
- listomania()
- t2.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement