8, changes to porting h for mac
parent
497070c3bb
commit
4bf23d0fd1
Binary file not shown.
|
@ -188,6 +188,27 @@ bool threadSetPriority(threadid_t tid, int prio);
|
|||
#else // Posix
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <mach/mach_time.h>
|
||||
#include <mach/mach.h> // This one makes policy thread work
|
||||
#include <mach/mach_init.h>
|
||||
#include <mach/thread_policy.h>
|
||||
#define CLOCK_REALTIME 0
|
||||
#define CLOCK_MONOTONIC 0
|
||||
|
||||
change get getTimeNs()
|
||||
|
||||
inline u32 getTimeNs()
|
||||
{
|
||||
//struct timespec ts;
|
||||
//clock_gettime(CLOCK_REALTIME, &ts);
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
// tv_sec = tv.tv_sec;
|
||||
// tv_nsec = tv.tv_usec * 1000;
|
||||
return tv.tv_sec * 1000000000 + tv.tv_usec*1000;
|
||||
}
|
||||
|
||||
|
||||
inline u32 getTimeS()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue