RTI Connext Java API
Version 5.2.0
|
Unsupported utility APIs. More...
Static Public Member Functions | |
static void | spin (long spinCount) |
Performs the spin operation as many times as indicated. | |
static native long | get_spin_per_microsecond () |
Returns the number of spin operations to perform to wait 1 microsecond. | |
Unsupported utility APIs.
|
static |
Performs the spin operation as many times as indicated.
Spinning is the action of performing useless operations in a for loop in order to actively wait some time without yielding the CPU. Given that the resolution of sleep is in the order of ms, you can use this utility to wait times in the order of microseconds. To properly use this functionality, it is useful to measure previously the number of spin operations needed to wait the equivalent to 1 microsecond (using the utility get_spin_per_microsecond) and then compute the corresponding spin count desired.
spinCount | <<in>> Number of spin operations to perform. |
|
static |
Returns the number of spin operations to perform to wait 1 microsecond.
This utility can be used to measure how many spin operations must be performed to wait 1 microsecond. Since the time that it takes the CPU to perform 1 spin operation depends on the CPU frequency, it is recommended to use this utility before using spin().