Load test back

This commit is contained in:
2025-05-08 00:11:24 +03:00
parent 5a0357c42e
commit 56d82ecdef
+16 -13
View File
@@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using System.Net; using System.Net;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@@ -120,23 +121,25 @@ class Program
Console.WriteLine($"Token state {cts.Token.IsCancellationRequested}"); Console.WriteLine($"Token state {cts.Token.IsCancellationRequested}");
DemoCheck.TaskCancelation = true; DemoCheck.TaskCancelation = true;
const int iterations = 10000;
var timer = Stopwatch.StartNew();
var x = 0;
for (int i = 0; i < iterations; i++)
{
x = loadSingleton.Next(x);
}
timer.Stop();
Console.WriteLine("X is {0}", x);
Console.WriteLine("Time : {0}", timer.Elapsed.TotalMilliseconds);
Console.WriteLine($"Time per call: {timer.Elapsed.TotalMilliseconds / iterations} ms");
frontendBridge.Disconnect(); frontendBridge.Disconnect();
DemoCheck.Show(); DemoCheck.Show();
Console.ReadKey(); Console.ReadKey();
//
// const int iterations = 10000;
// var timer = Stopwatch.StartNew();
// var x = 0;
// for (int i = 0; i < iterations; i++)
// {
// x = loadSingleton.Next(x);
// }
//
// timer.Stop();
// Console.WriteLine("X is {0}", x);
// Console.WriteLine("Time : {0}", timer.Elapsed.TotalMilliseconds);
// Console.WriteLine($"Time per call: {timer.Elapsed.TotalMilliseconds / iterations} ms");
} }
} }