url = 'http://python.org/'
f1 = lambda url: urllib2.urlopen(url).close()
f2 = lambda url: urllib2.urlopen(url).read()
for func in [f1, f2]:
started = time.time()
for i in xrange(10):
func(url)
print time.time() - started