#include "rtc.h"

tRTC_REAL_TIME_CLOCK rtcClock1, rtcClock2;

rtcConfig.oscillatorFrequencykHz = 32;
rtc_init();

rtc_getRTCRawClock(&rtcClock1);
utilslib_delayUs(1000);
rtc_getRTCRawClock(&rtcClock2);

WICED_BT_TRACE("NUM TICKS ELAPSED: %d\r\n", rtcClock2.reg32map.rtc32[0] - rtcClock1.reg32map.rtc32[0]);

 

 

The tick count above is useful for providing time stamps with a high resolution. The counter goes up to 48 bits, to read more than 32, you’ll need to properly deference the higher bits.