1.秒级
import time startTime = time.time() endTime = time.time() print endTime-startTime
2.微秒级
from datetime import datetime start_ = datetime.utcnow() end_ = datetime.utcnow() c = (end_ - start_) print c.seconds print c.microseconds