1. python 程序运行时间:time.time() start = time.time() #long running #do something other end = time.time() print end-start cpu执行时间:time.clock() 2. shell 2.1 用 date 相减 #!/bin/bash start=$(