hello ebverybody.
I need to measure the time in some statement and i have the following code to do that
Code:
#include <stdio.h>
#include <time.h>
int main () {
clock_t time_before;
clock_t time_after;
int i_value=0;
double tot_time;
for(i=0; i<N_RUNS; i++)
{
i_value++;
}
time_after=clock();
tot_time=((double)(time_after-time_before)/(double)CLOCKS_PER_SEC); /*time in seconds */
printf("total time %f \n",tot_time);
The last statement print 0 when i test it. Can somebody tell me what is wrong whith those statement and how should i correct it