查看函数的执行时间:
[root@node110 decorator]# cat exec_time.py
#!/usr/bin/env python
import time
def sayhi():
start=time.time()
print 'hi yoursister...'
time.sleep(0.1)
end= time.time()
print 'Thisfunction costs:',end-start
sayhi()