Python之时间统计

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

 

你可能感兴趣的:(python)