#include<ctime> using namespace std; void main(){ clock_t begin = clock(); //... clock_t end = clock(); }