Get random value within a range
using System;
using System.Collections.Generic;
namespace TradeHelp.Utilities
{
/// <summary>
///
/// </summary>
public static class RandomHelper
{
private static readonly Random _random = new Random(DateTime.Now.Millisecond);
/// <summary>
///
/// </summary>
/// <param name="min"></param>
/// <param name="max"></param>
/// <returns></returns>
public static int GetRandom(int min, int max)
{
return _random.Next(min, max);
}
}
}
Related examples in the same category