示例#1
0
 static TimeSpan ExpDelay(int retryNumber) =>
 Math.Pow(2, retryNumber).Apply(x => x * 1000)
 .Apply(x => x + Rnd.NextInt32(0, (int)(x / 3)))
 .Apply(TimeSpan.FromMilliseconds);
示例#2
0
 static Task <T> OnlinerDelay <T>(Task <T> task) =>
 Delay(task, Rnd.NextInt32(2000, 5000));