I want to intentionally delay one process in one function.

I want to intentionally delay one process in one function.

I want to get the message_id from the content notified by deluge's posttochannnel immediately with cliq's api and have it stored in cliq's database, but the success rate of saving to the database is low.

Since the cliq api is executed immediately after the posttochannnel process is executed, there may be a time lag that prevents the acquisition, resulting in an error.

Is it possible to intentionally delay the execution of a function within the same function?

I am not good at english.
Sorry if it's hard to read.