#include <time.h>
time_t start,end;
time (&start);
//code here
time (&end);
double dif = difftime (end,start);
printf ("Elasped time is %.2lf seconds.", dif );
開始時間と終了時間の両方で0.000を取得しています。エラーの原因がわかりません。
また、経過時間を計算するには、time(start)とtime(end)またはstart = clock()とend = clock()を使用することをお勧めします。