Results 1 to 2 of 2
i wrote a program etime which returns elapsed time since last call to function while i try to excecte my prog i got an error.
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':
../sysdeps/i386/elf/start.S:115: ...
- 10-03-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 2
problem in excecution
i wrote a program etime which returns elapsed time since last call to function while i try to excecte my prog i got an error.
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
float etime(void)
{
static struct timeval start_time;
static struct timeval stop_time;
float elapsed_time;
static int i;
i++;
if(gettimeofday(&stop_time,NULL)!=0)
exit(0);
elapsed_time = (float)stop_time.tv_sec - (float)start_time.tv_sec +
((float)stop_time.tv_usec -(float) start_time.tv_usec) / 1.e6;
start_time = stop_time;
/* printf("%f\n",elapsed_time);*/
return(elapsed_time);
}
- 10-04-2007 #2


Reply With Quote