I am interested in showing the execution time for a program in C, at diverse points, using ctime. I have tried something like that, but it must not be right...
int main() {
time_t tm1, tm2;
tm1 = time(NULL);
sleep(2);
tm2 = ctime(tm1);
printf("%d\n", tm2-tm1);
return 0;
}
Do you have any suggestion or a proper example? Thanks in advance