Hi, I'm trying to count the execution of function in my code (that takes over an hour), and I'm using clock(), but I'm getting some errors, since the time calculated is negative. I'm doing like this:
long double time;
clock_t start, t_end;
t_start = clock();
algorithm->execute();
t_end = clock();
time = ((long double) t_end - t_start) / CLOCKS_PER_SEC;
cout << time << endl;
I'm I doing something wrong? Thanks in advance.