Question
How to set Prescaler and Period value for F767ZI to calculate the execution time of the function?

This is my clock configuration.
This is setting for TIM1,
htim1.Instance = TIM1;
htim1.Init.Prescaler = 7999;
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
htim1.Init.Period = 1999;
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim1.Init.RepetitionCounter = 0;
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
{
Error_Handler();
}
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}This is how I'm measuring the time for function,
TIM1 -> CR1 |= TIM_CR1_CEN;
status = RSA_Encrypt(&PubKey_st, Message, sizeof(Message), output);
sprintf((char*)buf1,"ET:%d.%3d S \r\n",(uint)TIM1->CNT/1000 , (uint)TIM1->CNT%1000 );
HAL_UART_Transmit(&huart3, (uint8_t*)buf1, 15, 100);What is wrong with the timer? it say it takes 8 seconds to complete the 2048 RSA encryption decryption! As I change the values of prescaler and period the timing changes.
Can anybody plz tell me what would be the exact values of those?
I don't want any other techniques to measure the execution time. This is what I suppose to make it run.
Any kind of help is appreciated.
