How can I measure the time between 2 events using the icapture function on the Xbee S3 programmable?

Hello, I just want to get the time between to digital pulses. I read the help, but I couldn’t figure out it.

This is the code that Im working. Thanks

#include
#include

unsigned int counter =0;

unsigned int number, captcount=0;

void main(void)
{
sys_hw_init();
sys_xbee_init();
sys_app_banner();

//Interruption Routine

icapture_config(icapture0, ICAPTURE_RISING, TRUE, 1000000);		//icapture_config(xpin_t pin, uint8_t edge, bool_t enable, uint32_t max_u_secs)


/*icapture0 to trigger an interrupt on rising edges, expecting a maximum of 1 second between edges:
 * */

for (;;) {
		
	number = icapture_captcount_to_usec(icapture0, captcount);
			
	sys_watchdog_reset();
	sys_xbee_tick();
}

}