Timer use to calculate duration of PowerLow mode and active mode in ADICUP3029

Hi everyone, 

I need a timer for my ADICUP3029 so i can calculate the duration how much it takes to enter in the CPU in PowerLow mode and exit from it .

I put it already the cpu in PowerLow mode and exit from it after using GPIO interrupts. 

#define FLEXI_MODE true
//creating exit and enter flexi mode
#if FLEXI_MODE
void Host_EnterFlexi(void)
{    
    bFlexiExitFlag = 0;
    /* automatically exit flexi mode */
    adi_pwr_EnterLowPowerMode(ADI_PWR_MODE_FLEXI, &bFlexiExitFlag, 0);
}

void Host_ExitFlexi(void)
{
     adi_pwr_ExitLowPowerMode(&bFlexiExitFlag);
}
#endif
.....


adi_gpio_RegisterCallback(ADI_GPIO_INTA_IRQ, pinIntCallbackA,NULL);
...
int main()
{
     int i;
     volatile int32_t j;
     initplatform();
     while(1)
     {
          
              /* automatically exit flexi mode */
              for(i=0;i<10;i++)
              {pADI_GPIO1->TGL |= 1<<15;
	       pADI_GPIO2->TGL |= 1<<0;
               AD5940_Delay10us(10000);
              }
              #if FLEXI_MODE
              Host_EnterFlexi();
              #endif
              // Check if button is high or low for the moment
              //uint8_t state=pADI_GPIO1->IN;
              //uint8_t current_state= CHECK_BIT(state,1);
              //if (current_state==1)
              //{
             
                  
              }
}
static void pinIntCallbackA(void* pCBParam, uint32_t Port,  void* PinIntData)
{
    volatile int32_t i;
    /* button */ 
    if((Port == (uint32_t)ADI_GPIO_PORT1) && (*(uint32_t*)PinIntData & ADI_GPIO_PIN_1))
    {
        for(i = 0; i < (int32_t)(2.7*26000.0); i++); //set up 1 ms time
        if((*(uint32_t*)PinIntData & ADI_GPIO_PIN_1))
        {
            
            #if FLEXI_MODE
            Host_ExitFlexi();
            #endif
            pADI_GPIO1->TGL |= 1<<15;
	    pADI_GPIO2->TGL |= 1<<0;
	    pADI_GPIO1->INT|=1<<1;
    	}
    }
}


Can you help me with this code please ?