This is Unofficial EPICS BASE Doxygen Site
osdMonotonic.c File Reference
#include <mach/mach.h>
#include <mach/mach_time.h>
#include "dbDefs.h"
#include "errlog.h"
#include "epicsTime.h"
#include "generalTimeSup.h"
+ Include dependency graph for osdMonotonic.c:

Go to the source code of this file.

Macros

#define EPICS_EXPOSE_LIBCOM_MONOTONIC_PRIVATE
 

Functions

void osdMonotonicInit (void)
 
epicsUInt64 epicsMonotonicResolution (void)
 Monotonic time resolution, may not be accurate. Returns the minimum non-zero time difference between two calls to epicsMonotonicGet() in units of nanoseconds. More...
 
epicsUInt64 epicsMonotonicGet (void)
 Fetch monotonic counter, returns the number of nanoseconds since some unspecified time. More...
 

Macro Definition Documentation

#define EPICS_EXPOSE_LIBCOM_MONOTONIC_PRIVATE

Definition at line 10 of file osdMonotonic.c.

Function Documentation

epicsUInt64 epicsMonotonicGet ( void  )

Fetch monotonic counter, returns the number of nanoseconds since some unspecified time.

Definition at line 29 of file osdMonotonic.c.

30 {
31  uint64_t val = mach_absolute_time();
32  return val * tbinfo.numer / tbinfo.denom;
33 }
epicsUInt64 epicsMonotonicResolution ( void  )

Monotonic time resolution, may not be accurate. Returns the minimum non-zero time difference between two calls to epicsMonotonicGet() in units of nanoseconds.

Definition at line 24 of file osdMonotonic.c.

25 {
26  return 1e-9 * tbinfo.numer / tbinfo.denom;
27 }
void osdMonotonicInit ( void  )

Definition at line 19 of file osdMonotonic.c.

20 {
21  (void)mach_timebase_info(&tbinfo);
22 }