Hello
NCS2.0.2, nRF5340-DK, VScode
follow one line to get clock time, run it in i2s data_handler
uint32_t now = k_cycle_get_32();
printk("%d\n",(((now)*1000)/CONFIG_SYS_CLOCK_TICKS_PER_SEC));
printk("%d\n",(((now)*1000)/CONFIG_SYS_CLOCK_TICKS_PER_SEC));

why the max number is 131063?
uint32_t get_cputimer_ms()
{
uint32_t now = k_cycle_get_32();
return (((now)*1000)/CONFIG_SYS_CLOCK_TICKS_PER_SEC);
}
static void data_handler(nrfx_i2s_buffers_t const *p_released, uint32_t status)
{
if (NRFX_I2S_STATUS_NEXT_BUFFERS_NEEDED == status)
{
for(int i=0;i<I2S_BUFFER_COUNT;i++)
{
if(current_buffer==&initial_buffers[i])
{
current_buffer=&initial_buffers[(i+1)%I2S_BUFFER_COUNT];
break;
}
}
nrfx_err_t err = nrfx_i2s_next_buffers_set(current_buffer);
if (err != NRFX_SUCCESS)
printk("Error!, continuing running as if nothing happened, but you should probably investigate.\n");
}
if (p_released)
{
if (p_released->p_tx_buffer != NULL)
{
mp_block_to_fill = (uint32_t *)p_released->p_tx_buffer;
printk(" %d\n",get_cputimer_ms());
}
}
}CONFIG_THREAD_NAME=y
CONFIG_ISR_STACK_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=28192
CONFIG_MAIN_STACK_SIZE=18192
Best regards