pub unsafe extern "C" fn rtapi_clock_set_period(
    nsecs: c_long
) -> c_long
Expand description

’rtapi_clock_set_period() sets the basic time interval for realtime tasks. All periodic tasks will run at an integer multiple of this period. The first call to ’rtapi_clock_set_period() with ‘nsecs’ greater than zero will start the clock, using ‘nsecs’ as the clock period in nano-seconds. Due to hardware and RTOS limitations, the actual period may not be exactly what was requested. On success, the function will return the actual clock period if it is available, otherwise it returns the requested period. If the requested period is outside the limits imposed by the hardware or RTOS, it returns -EINVAL and does not start the clock. Once the clock is started, subsequent calls with non-zero ‘nsecs’ return -EINVAL and have no effect. Calling ’rtapi_clock_set_period() with ‘nsecs’ set to zero queries the clock, returning the current clock period, or zero if the clock has not yet been started. Call only from within init/cleanup code, not from realtime tasks. This function is not available from user (non-realtime) code.