I am trying to use gettimeofday in Objective-C. However, I get these two problems:
'Implicit declaration of' gettimeofday 'function invalid in C99
"The gettimeofday declaration must be imported from the Darwin.POSIX.sys.time module before it is needed."
I performed these imports:
#import <UIKit/UIKit.h> #include <time.h>
But is the problem still persisting?
Thanks in advance. / Jbj
import <sys/time.h> instead of #include <time.h>
<sys/time.h>
#include <time.h>
in C time.h declares functions like time (), clock (), etc .; and In POSIX (OS specification) has all the C structure and macro, and it expands with the time interval functions in sys/time.h
C
time.h
POSIX
sys/time.h