Delays in Critical Section

Hello everyone,

I’ve got a crit section in my app and I need a delay for a predetermined amount of time in this crit section (no way around it). RTOS API doesn’t work in a crit section so what’s the best solution for this? I was thinking about time.h functions
Also, on the same topic - how to measure runtime in the crit section. I also need to implement that.