macro TEST_PAL_GET_HIGHRES_TIME_UNITS_PER_SECOND

From liblfds.org
Revision as of 22:05, 12 December 2015 by Admin (talk | contribs) (→‎See Also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source File

└───liblfds700
    └───inc
        └───liblfds700
                lfds700_lfds700_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