代码改变世界

python版GetTickCount()

2013-08-01 08:53  江湖么名  阅读(1701)  评论(0编辑  收藏  举报

time.clock()

return the current processor time as a floating point number expressed in seconds.

即返回一个浮点数,精度是毫秒



time.sleep(2.5)
y = time.clock()
print y - x

返回值
2.4998947806