I am trying to use time() to measure various points of my program.
What I don\'t understand is why the values in the before and after are the same? I understand thi
They are they same because your doSomething function happens faster than the granularity of the timer. Try:
printf ("**MyProgram::before time= %ld\n", time(NULL)); for(i = 0; i < 1000; ++i) { doSomthing(); doSomthingLong(); } printf ("**MyProgram::after time= %ld\n", time(NULL));