macro TEST_PAL_GET_HIGHRES_TIME_UNITS_PER_SECOND

From liblfds.org
Revision as of 20:16, 17 February 2017 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source File

└───liblfds711
    └───inc
        └───liblfds711
                lfds711_lfds711_porting_abstraction_layer_compiler.h

Macro

#define TEST_PAL_GET_HIGHRES_TIME_UNITS_PER_SECOND( pointer_to_time_units_per_second )

Parameters

pointer_to_time_units_per_second

A pointer to an int long long unsigned, which will be set to the number of high resolution time units per second.

Return Value

No return value.

Optionality

This macro is optional. If it is not implemented, the define must be absent, rather than being empty.

Notes

This macro and the TEST_PAL_GET_HIGHRES_TIME macro are needed for one the NOP Test. If either is unimplemented, the test is skipped.

Example

#define TEST_PAL_GET_HIGHRES_TIME_UNITS_PER_SECOND( pointer_to_time_units_per_second )        \
{                                                                                             \
  struct timespec                                                                             \
    res;                                                                                      \
                                                                                              \
  clock_getres( CLOCK_MONOTONIC_RAW, &res );                                                  \
  *pointer_to_time_units_per_second = NUMBER_OF_NANOSECONDS_IN_ONE_SECOND / res.tv_nsec;      \
}

See Also