Get Random Number Between Two Numbers

This can be useful for generating test data.
Or perhaps for generating a random delay in seconds.

<pre>
        public static double GetRandomNumber(double minimum, double maximum)
        {
            Random random = new Random();
            return random.NextDouble() * (maximum - minimum) + minimum;
        }
</pre>

Leave a Reply

Recent Posts

Archives

Categories

Meta

All Rights Reserved Theme by 404 THEME.