I'm trying to use the timersub macro on Ubuntu Linux. When I compile I
get the error:
<file>.c:<lin e #>: warning: implicit declaration of function
'timersub'
Where <fileis the file name and <line #is the line number. I take
that to mean I that the timersub macro hasn't been #included. My code
looks about like this:
#include <time.h>
#include <sys/time.h>
struct timeval *time_start, *time_end, *time_diff;
gettimeofday(ti me_start);
// some stuff runs
gettimeofday(ti me_end);
timersub(time_s tart, time_end, time_diff);
What am I doing wrong?
-Aaron
get the error:
<file>.c:<lin e #>: warning: implicit declaration of function
'timersub'
Where <fileis the file name and <line #is the line number. I take
that to mean I that the timersub macro hasn't been #included. My code
looks about like this:
#include <time.h>
#include <sys/time.h>
struct timeval *time_start, *time_end, *time_diff;
gettimeofday(ti me_start);
// some stuff runs
gettimeofday(ti me_end);
timersub(time_s tart, time_end, time_diff);
What am I doing wrong?
-Aaron
Comment