using time() to measure how long a function takes
- by hap497
Hi,
I am trying to use time() to measure various points of my program.
http://www.cplusplus.com/reference/clibrary/ctime/time/
What I don't understand is why the values in the before and after are Different?
I understanding this is not the best way to profile my program, I just want to see how long does something take.
printf ("**MyProgram::before time= %ld\n", time(NULL));
doSomthing();
doSomthingLong();
printf ("**MyProgram::after time= %ld\n", time(NULL));
Thank you.