123456789101112131415
#include <iostream> #include <ctime> #include <iomanip> using namespace std; int main() { double timer01 = clock(); //stuff double timer02 = clock(); cout.precision(4); cout << "Program run-time is " << fixed << (timer02 - timer01) / CLOCKS_PER_SEC << " seconds." << endl; return 0; }
$ time ./program.bin