double start_time = (double)getTickCount();
.
.
.程序
.
.
.
cout << “running time=” << ((double)getTickCount() - start_time) / getTickFrequency() << endl;
import time
start_time = time.time()
…
end_time = time.time()
print(‘totally cost’,end_time-start_time,‘s’)