I have the following if, as you can see every time the variable is false it enters and executes the send payments method, I have this if inside a cycle so it is constantly executing
SendPago is a service and since it is constantly running the service returns me that it cannot send so many requests in such a short time, inside this if I put a Thread.Sleep(10000);
so that it can tell it before entering this method wait 10 seconds and it works but what I have seen is that every time you enter the Thread the app is blocked for those 10 seconds
How can I inside the if say that for every minute it only executes 5 times, or wait a while so that it doesn't execute every second?
" Without Using a Timer "
Inte = pagos.Integration;
if (Inte == false)
{
Thread.Sleep(10000);
var Respuesta = await proxy.EnviarPago(pagos);
}