mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
Benchmark
This commit is contained in:
@@ -182,6 +182,18 @@ namespace UVtools.GUI.Forms
|
||||
progressBar.Style = ProgressBarStyle.Blocks;
|
||||
}
|
||||
|
||||
private void UpdateResults(bool isSingleThread, long milliseconds)
|
||||
{
|
||||
decimal seconds = Math.Round(milliseconds / 1000m, 2);
|
||||
//var text = (isSingleThread ? "Single" : "Multi") + $" Thread: {Math.Round(SingleThreadTests / seconds, 2)} OPS ({seconds}s)";
|
||||
|
||||
if(isSingleThread)
|
||||
lbSingleThreadResults.Text = $"Single Thread: {Math.Round(SingleThreadTests / seconds, 2)} {RunsAbbreviation} ({SingleThreadTests} tests / {seconds}s)";
|
||||
else
|
||||
lbMultiThreadResults.Text = $"Multi Thread: {Math.Round(MultiThreadTests / seconds, 2)} {RunsAbbreviation} ({MultiThreadTests} tests / {seconds}s)"; ;
|
||||
}
|
||||
|
||||
#region Tests
|
||||
public byte[] EncodeCbddlpImage(Mat image, byte bit = 0)
|
||||
{
|
||||
List<byte> rawData = new List<byte>();
|
||||
@@ -238,7 +250,7 @@ namespace UVtools.GUI.Forms
|
||||
// Collect stragglers
|
||||
AddRep();
|
||||
|
||||
|
||||
|
||||
return rawData.ToArray();
|
||||
}
|
||||
|
||||
@@ -385,19 +397,6 @@ namespace UVtools.GUI.Forms
|
||||
return rawData.ToArray();
|
||||
}
|
||||
|
||||
private void UpdateResults(bool isSingleThread, long milliseconds)
|
||||
{
|
||||
decimal seconds = Math.Round(milliseconds / 1000m, 2);
|
||||
//var text = (isSingleThread ? "Single" : "Multi") + $" Thread: {Math.Round(SingleThreadTests / seconds, 2)} OPS ({seconds}s)";
|
||||
|
||||
if(isSingleThread)
|
||||
lbSingleThreadResults.Text = $"Single Thread: {Math.Round(SingleThreadTests / seconds, 2)} {RunsAbbreviation} ({SingleThreadTests} tests / {seconds}s)";
|
||||
else
|
||||
lbMultiThreadResults.Text = $"Multi Thread: {Math.Round(MultiThreadTests / seconds, 2)} {RunsAbbreviation} ({MultiThreadTests} tests / {seconds}s)"; ;
|
||||
}
|
||||
|
||||
#region Tests
|
||||
|
||||
public Mat RandomMat(int width, int height)
|
||||
{
|
||||
var bytes = new byte[width * height];
|
||||
|
||||
Reference in New Issue
Block a user