public static void Main()
var nextExecution = new DateTime(2020, 02, 25);
Console.WriteLine("============================================ALL DELAYS=============================================");
for (var i=1;i<=limit;i++)
delay = delay > maxDelay ? maxDelay : delay;
nextExecution = nextExecution.AddSeconds(delay);
Console.WriteLine("Retry {0} : {1}s delay -> {2:dd/MM/yyyy HH:mm:ss}", i, delay, nextExecution);
Console.WriteLine("========================================SPECIFIC DELAYS================================================");
var postingDate = new DateTime(2020, 02, 25);
Console.WriteLine("{0} : {1:dd/MM/yyyy HH:mm:ss}", retry, GetNextExecution(postingDate, retry));
Console.WriteLine("{0} : {1:dd/MM/yyyy HH:mm:ss}", retry, GetNextExecution(postingDate, retry));
Console.WriteLine("{0} : {1:dd/MM/yyyy HH:mm:ss}", retry, GetNextExecution(postingDate, retry));
Console.WriteLine("{0} : {1:dd/MM/yyyy HH:mm:ss}", retry, GetNextExecution(postingDate, retry));
Console.WriteLine("{0} : {1:dd/MM/yyyy HH:mm:ss}", retry, GetNextExecution(postingDate, retry));
private static DateTime GetNextExecution(DateTime nextExecution, int attempt){
return GetNextExecution(nextExecution, limit);
for (var i=1; i<=attempt; i++)
delay = delay > maxDelay ? maxDelay : delay;
nextExecution = nextExecution.AddSeconds(delay);