Alternative for clock_gettime(CLOCK_REALTIME, &start); ?

error: use of undeclared identifier 'CLOCK_REALTIME'

clock_gettime(CLOCK_REALTIME, &stop)


why i still have this error above?

i have defined time.h

MacBook Pro, OS X Mavericks (10.9.2)

Posted on Mar 23, 2014 8:13 AM

Reply
2 replies

Jul 4, 2015 3:34 PM in response to MrHoffman

Hello M. rudiliu and M. MrHoffman,


long ago, once upon a time, before the mob realized those calls were missing (1) (while porting some stuff from (and to) FB , e.g POSIX.1-2008, mandatory stuff) I wrote a draft about this issue:


clock_gettime_stub.c

posix-realtime-stub.c


now, that was only a quick study ; but I think, all the pointers you might need to, for writing a better glueish-interface are there.


reading the file back ; (it's been a while) ; there is a missing call to : mach_port_deallocate(mach_task_self(), clk); don't forget to let go your conn when finished, buggy-me.


1- because few folks were using it ; and then it spread to third-party libs, and so on...


-- Best and enjoy!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Alternative for clock_gettime(CLOCK_REALTIME, &start); ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.