من تو ++VC نوشتم . اینجوری :
#include <ctime>
clock_t cl=clock()
cout << clock()-cl << endl;