Here's a nice little code tidier for timing you might like:

```
>>> import time       
>>> from contextlib import contextmanager
>>> @contextmanager
... def timer(name):
...   start = time.time()
...   yield
...   print name, time.time() - start
... 
>>> with timer("brian"):
...   a = 1.1           
...   for i in range(1000000):
...     a = a + 1.1
... 
brian 0.198040962219
```