Exemplo n.º 1
0
 /// <summary>
 /// Produces the random interval within a specified range.
 /// </summary>
 /// <param name="minimum">The minimum value.</param>
 /// <param name="maximum">The maximum value.</param>
 public static TimeSpan Next(TimeSpan minimum, TimeSpan maximum)
 {
     return(TimeSpan.FromTicks(minimum.Ticks + (long)(RandomNumber.NextDouble() * (maximum.Ticks - minimum.Ticks))));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Produces the random interval less than the specified maximum.
 /// </summary>
 /// <param name="maximum">The maximum value.</param>
 public static TimeSpan Next(TimeSpan maximum)
 {
     return(RandomNumber.Next(TimeSpan.Zero, maximum));
 }