Change the screen with delay

hello everyone,
I have an application using LVGL. I have a screen and several of buttons. When I click a button, It will change the mode of the machine with same changes in parameters. So that, I need some delay to let the system configure done before a new screen appear. I use ST7565 and STM32L476 for my application. Can anyone give me some ideas for this?
I’m looking forward to seeing your reply as soon as possible.
Thanks,
Best regards,

If you want a fixed delay, create a one-shot lv_task and switch the screen inside it.

Maybe the better way to think about it is not
“I need some delay to let the system configure done before a new screen appear”
But
“I need to wait for system to configure before changing to a new screen”

Usually this mean setting a flag variable based on the button and not directly switching the screen based on the button. If you think of it more like a state machine, you have an action that triggers a state change. The state change preps for the next screen and you wait for that to complete before display the new screen.

It can be dangerous to rely on just delays, and making sure you know it is all complete first.

If you do want to do the task, maybe setup the task as a check if config is complete before transitioning.

Can you show me the function to help me with delay?? I mean I want to switch to another waiting screen while the system set up done and back to my main screen