Part of code execute every 5 minutes C++ : I am try to implement wait in c++. I cannot use sleep since it stop the current execution.

For eg.
        
    do
    {
        if(something)
        {
           //Do something
        }

        if(something)
        {
           //Do something
        }
  
        if(every 5 minutes)
        {
           //Do something only once after 5 minutes
        }
    }
    while(true)

I cannot use sleep since it will stop the execution. Can you help me with this since I need to implement this in this do while loop. I would have used threads with detach but I want to this 1 a single do while loop.

