clock()

#include <iostream>
#include <time.h>
using namespace std;

int main(){
    clock_t before = clock();
    for (int i = 0; i < N; ++i)
        cout << i << endl;
    cout <<"SEC :"<< (double)(clock() - before) / CLOCKS_PER_SEC << endl;

    return 0;
}

 

You may also like...