Skip to content

MarkCiliaVincenti/ThreadSafeRandomizer

Repository files navigation

ThreadSafeRandomizer ThreadSafeRandomizer

GitHub Workflow Status Nuget Nuget

An efficient thread-safe randomizer.

Installation

The recommended means is to use NuGet, but you could also download the source code from here.

Usage

Replace:

var random = new Random();
var myNum = random.Next();

With:

var myNum = ThreadSafeRandom.Instance.Next();