I am trying to use gettimeofday in Objective-C. However, i get these two issues:
"Implicit declaration of function 'gettimeofday' is invalid in C99"
"Declaration of 'gettimeofday' must be imported from module 'Darwin.POSIX.sys.time' before it is required"
I have performed these imports:
#import <UIKit/UIKit.h>
#include <time.h>
But the issue still persists?
Thanks in advance. /JBJ
import <sys/time.h>
instead of #include <time.h>
in C
time.h
declares functions like time(), clock() etc; and In POSIX
(OS specification) it has all C
structure and macro and it is extended with time interval functions in sys/time.h
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With