If you are HAL user, you can use HAL_Delay function.
Imen
In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
That tends to use a TIM or SysTick, and a software based counter providing millisecond level granularity.
I sense the OP wants software spin loops, or sub-microsecond. The vague 'title as a question' leaves a lot to be desired. Ask better/smarter questions.
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Be more explicit. What is the real need behind? As some say, please elaborate. Making delays without timer can bring exotic answers such as put a cap on a gpio, charge it with the gpio, then switch it as exti input to trigger an interrupt or even a stopped clock restart...
The use of the volatile keyword is strongly recommended so the compiler/optimizer doesn't fold the loop. These types of loops should generally be avoided
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..