public void PerformanceTest()
{
const int clientCount = 500;
var threads = new List<Thread>(clientCount);
#if !NETCORE
ThreadPool.SetMinThreads(500, 50);
ThreadPool.SetMaxThreads(1000, 50);
#endif
for (int i = 0; i < clientCount; i++)
{
threads.Add(new Thread(() => {
var html = (ListeningOn + "long_running").GetStringFromUrl();
}));
}
var sw = new Stopwatch();
sw.Start();
for (int i = 0; i < clientCount; i++)
{
threads[i].Start();
}
for (int i = 0; i < clientCount; i++)
{
threads[i].Join();
}
sw.Stop();
Trace.TraceInformation("Elapsed time for " + clientCount + " requests : " + sw.Elapsed);
}