sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

mach_gettime.h (822B)


      1 #ifndef mach_time_h
      2 #define mach_time_h
      3 
      4 #include <sys/types.h>
      5 #include <sys/_types/_timespec.h>
      6 #include <mach/mach.h>
      7 #include <mach/clock.h>
      8 
      9 /* The opengroup spec isn't clear on the mapping from REALTIME to CALENDAR
     10  being appropriate or not.
     11  http://pubs.opengroup.org/onlinepubs/009695299/basedefs/time.h.html */
     12 
     13 // XXX only supports a single timer
     14 #define TIMER_ABSTIME -1
     15 #define CLOCK_REALTIME CALENDAR_CLOCK
     16 #define CLOCK_MONOTONIC SYSTEM_CLOCK
     17 
     18 typedef int clockid_t;
     19 
     20 /* the mach kernel uses struct mach_timespec, so struct timespec
     21 	is loaded from <sys/_types/_timespec.h> for compatibility */
     22 // struct timespec { time_t tv_sec; long tv_nsec; };
     23 
     24 int clock_gettime(clockid_t clk_id, struct timespec *tp);
     25 
     26 #endif
     27 
     28 /*  Copyright (c) 2015-2018 Alf Watt - Open Source - https://opensource.org/licenses/MIT */