了解了几种方法过后决定以后自己还是使用 time.clock 函数: from time import clock t1 = clock() ....... t2 = clock() t = t2 - t1