The gettimeofday() function is defined in sys/time.h. Thus include it.
gettimeofday()
sys/time.h
BCS 746-000125