This commit is contained in:
parent c5b95332b5
commit 995daac4cc
10 changed files with 80 additions and 75 deletions

View File

@ -158,33 +158,33 @@
labelInsertTime.AutoSize = true;
labelInsertTime.Location = new Point(372, 16);
labelInsertTime.Name = "labelInsertTime";
labelInsertTime.Size = new Size(32, 15);
labelInsertTime.Size = new Size(202, 15);
labelInsertTime.TabIndex = 12;
labelInsertTime.Text = "0 ms";
labelInsertTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelReadTime
//
labelReadTime.AutoSize = true;
labelReadTime.Location = new Point(372, 45);
labelReadTime.Name = "labelReadTime";
labelReadTime.Size = new Size(32, 15);
labelReadTime.Size = new Size(202, 15);
labelReadTime.TabIndex = 13;
labelReadTime.Text = "0 ms";
labelReadTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelDeleteTime
//
labelDeleteTime.AutoSize = true;
labelDeleteTime.Location = new Point(372, 74);
labelDeleteTime.Name = "labelDeleteTime";
labelDeleteTime.Size = new Size(32, 15);
labelDeleteTime.Size = new Size(202, 15);
labelDeleteTime.TabIndex = 14;
labelDeleteTime.Text = "0 ms";
labelDeleteTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// FormDriversTests
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(424, 101);
ClientSize = new Size(594, 101);
Controls.Add(labelDeleteTime);
Controls.Add(labelReadTime);
Controls.Add(labelInsertTime);

View File

@ -12,6 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace RouteGuideView
{
@ -41,9 +42,9 @@ namespace RouteGuideView
_logger = logger;
_driverLogic = driverLogic;
numericUpDownInsert.Maximum = 1000;
numericUpDownRead.Maximum = 1000;
numericUpDownDelete.Maximum = 1000;
numericUpDownInsert.Maximum = 10000;
numericUpDownRead.Maximum = 10000;
numericUpDownDelete.Maximum = 10000;
}
/// <summary>
@ -69,7 +70,7 @@ namespace RouteGuideView
Experience = 1
};
stopwatch.Start();
stopwatch.Restart();
var operationResult = _driverLogic.Create(model);
if (!operationResult)
{
@ -78,7 +79,7 @@ namespace RouteGuideView
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelInsertTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelInsertTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -102,7 +103,7 @@ namespace RouteGuideView
stopwatch.Start();
_driverLogic.ReadList(entitiesCount);
stopwatch.Stop();
labelReadTime.Text = $"{stopwatch.ElapsedMilliseconds} ms";
labelReadTime.Text = $"Total time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds)} ms / Average time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -126,12 +127,12 @@ namespace RouteGuideView
var stopwatch = new Stopwatch();
for (int i = 1; i <= entitiesCount; i++)
{
stopwatch.Start();
stopwatch.Restart();
_driverLogic.Delete();
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelDeleteTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelDeleteTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{

View File

@ -53,27 +53,27 @@
labelDeleteTime.AutoSize = true;
labelDeleteTime.Location = new Point(376, 72);
labelDeleteTime.Name = "labelDeleteTime";
labelDeleteTime.Size = new Size(32, 15);
labelDeleteTime.Size = new Size(202, 15);
labelDeleteTime.TabIndex = 44;
labelDeleteTime.Text = "0 ms";
labelDeleteTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelReadTime
//
labelReadTime.AutoSize = true;
labelReadTime.Location = new Point(376, 43);
labelReadTime.Name = "labelReadTime";
labelReadTime.Size = new Size(32, 15);
labelReadTime.Size = new Size(202, 15);
labelReadTime.TabIndex = 43;
labelReadTime.Text = "0 ms";
labelReadTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelInsertTime
//
labelInsertTime.AutoSize = true;
labelInsertTime.Location = new Point(376, 14);
labelInsertTime.Name = "labelInsertTime";
labelInsertTime.Size = new Size(32, 15);
labelInsertTime.Size = new Size(202, 15);
labelInsertTime.TabIndex = 42;
labelInsertTime.Text = "0 ms";
labelInsertTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// buttonDelete
//
@ -184,7 +184,7 @@
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(424, 101);
ClientSize = new Size(594, 101);
Controls.Add(labelDeleteTime);
Controls.Add(labelReadTime);
Controls.Add(labelInsertTime);

View File

@ -12,6 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace RouteGuideView
{
@ -48,9 +49,9 @@ namespace RouteGuideView
_routeLogic = routeLogic;
_transportLogic = transportLogic;
numericUpDownInsert.Maximum = 1000;
numericUpDownRead.Maximum = 1000;
numericUpDownDelete.Maximum = 1000;
numericUpDownInsert.Maximum = 10000;
numericUpDownRead.Maximum = 10000;
numericUpDownDelete.Maximum = 10000;
}
/// <summary>
@ -76,7 +77,7 @@ namespace RouteGuideView
TransportId = transportId
};
stopwatch.Start();
stopwatch.Restart();
var operationResult = _routeLogic.Create(model);
if (!operationResult)
{
@ -85,7 +86,7 @@ namespace RouteGuideView
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelInsertTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelInsertTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -109,7 +110,7 @@ namespace RouteGuideView
stopwatch.Start();
_routeLogic.ReadList(entitiesCount);
stopwatch.Stop();
labelReadTime.Text = $"{stopwatch.ElapsedMilliseconds} ms";
labelReadTime.Text = $"Total time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds)} ms / Average time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -133,12 +134,12 @@ namespace RouteGuideView
var stopwatch = new Stopwatch();
for (int i = 1; i <= entitiesCount; i++)
{
stopwatch.Start();
stopwatch.Restart();
_routeLogic.Delete();
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelDeleteTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelDeleteTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{

View File

@ -53,27 +53,27 @@
labelDeleteTime.AutoSize = true;
labelDeleteTime.Location = new Point(376, 72);
labelDeleteTime.Name = "labelDeleteTime";
labelDeleteTime.Size = new Size(32, 15);
labelDeleteTime.Size = new Size(202, 15);
labelDeleteTime.TabIndex = 59;
labelDeleteTime.Text = "0 ms";
labelDeleteTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelReadTime
//
labelReadTime.AutoSize = true;
labelReadTime.Location = new Point(376, 43);
labelReadTime.Name = "labelReadTime";
labelReadTime.Size = new Size(32, 15);
labelReadTime.Size = new Size(202, 15);
labelReadTime.TabIndex = 58;
labelReadTime.Text = "0 ms";
labelReadTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelInsertTime
//
labelInsertTime.AutoSize = true;
labelInsertTime.Location = new Point(376, 14);
labelInsertTime.Name = "labelInsertTime";
labelInsertTime.Size = new Size(32, 15);
labelInsertTime.Size = new Size(202, 15);
labelInsertTime.TabIndex = 57;
labelInsertTime.Text = "0 ms";
labelInsertTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// buttonDelete
//
@ -184,7 +184,7 @@
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(424, 101);
ClientSize = new Size(594, 101);
Controls.Add(labelDeleteTime);
Controls.Add(labelReadTime);
Controls.Add(labelInsertTime);

View File

@ -12,6 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace RouteGuideView
{
@ -48,9 +49,9 @@ namespace RouteGuideView
_scheduleLogic = scheduleLogic;
_routeLogic = routeLogic;
numericUpDownInsert.Maximum = 1000;
numericUpDownRead.Maximum = 1000;
numericUpDownDelete.Maximum = 1000;
numericUpDownInsert.Maximum = 10000;
numericUpDownRead.Maximum = 10000;
numericUpDownDelete.Maximum = 10000;
}
/// <summary>
@ -79,7 +80,7 @@ namespace RouteGuideView
RouteId = routeId
};
stopwatch.Start();
stopwatch.Restart();
var operationResult = _scheduleLogic.Create(model);
if (!operationResult)
{
@ -88,7 +89,7 @@ namespace RouteGuideView
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelInsertTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelInsertTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -112,7 +113,7 @@ namespace RouteGuideView
stopwatch.Start();
_scheduleLogic.ReadList(entitiesCount);
stopwatch.Stop();
labelReadTime.Text = $"{stopwatch.ElapsedMilliseconds} ms";
labelReadTime.Text = $"Total time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds)} ms / Average time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -136,12 +137,12 @@ namespace RouteGuideView
var stopwatch = new Stopwatch();
for (int i = 1; i <= entitiesCount; i++)
{
stopwatch.Start();
stopwatch.Restart();
_scheduleLogic.Delete();
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelDeleteTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelDeleteTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{

View File

@ -53,27 +53,27 @@
labelDeleteTime.AutoSize = true;
labelDeleteTime.Location = new Point(376, 72);
labelDeleteTime.Name = "labelDeleteTime";
labelDeleteTime.Size = new Size(32, 15);
labelDeleteTime.Size = new Size(202, 15);
labelDeleteTime.TabIndex = 29;
labelDeleteTime.Text = "0 ms";
labelDeleteTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelReadTime
//
labelReadTime.AutoSize = true;
labelReadTime.Location = new Point(376, 43);
labelReadTime.Name = "labelReadTime";
labelReadTime.Size = new Size(32, 15);
labelReadTime.Size = new Size(202, 15);
labelReadTime.TabIndex = 28;
labelReadTime.Text = "0 ms";
labelReadTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelInsertTime
//
labelInsertTime.AutoSize = true;
labelInsertTime.Location = new Point(376, 14);
labelInsertTime.Name = "labelInsertTime";
labelInsertTime.Size = new Size(32, 15);
labelInsertTime.Size = new Size(202, 15);
labelInsertTime.TabIndex = 27;
labelInsertTime.Text = "0 ms";
labelInsertTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// buttonDelete
//
@ -184,7 +184,7 @@
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(424, 101);
ClientSize = new Size(594, 101);
Controls.Add(labelDeleteTime);
Controls.Add(labelReadTime);
Controls.Add(labelInsertTime);

View File

@ -12,6 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace RouteGuideView
{
@ -41,9 +42,9 @@ namespace RouteGuideView
_logger = logger;
_stopLogic = stopLogic;
numericUpDownInsert.Maximum = 1000;
numericUpDownRead.Maximum = 1000;
numericUpDownDelete.Maximum = 1000;
numericUpDownInsert.Maximum = 10000;
numericUpDownRead.Maximum = 10000;
numericUpDownDelete.Maximum = 10000;
}
/// <summary>
@ -69,7 +70,7 @@ namespace RouteGuideView
Number = i
};
stopwatch.Start();
stopwatch.Restart();
var operationResult = _stopLogic.Create(model);
if (!operationResult)
{
@ -78,7 +79,7 @@ namespace RouteGuideView
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelInsertTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelInsertTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -102,7 +103,7 @@ namespace RouteGuideView
stopwatch.Start();
_stopLogic.ReadList(entitiesCount);
stopwatch.Stop();
labelReadTime.Text = $"{stopwatch.ElapsedMilliseconds} ms";
labelReadTime.Text = $"Total time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds)} ms / Average time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -126,12 +127,12 @@ namespace RouteGuideView
var stopwatch = new Stopwatch();
for (int i = 1; i <= entitiesCount; i++)
{
stopwatch.Start();
stopwatch.Restart();
_stopLogic.Delete();
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelDeleteTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelDeleteTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{

View File

@ -53,27 +53,27 @@
labelDeleteTime.AutoSize = true;
labelDeleteTime.Location = new Point(376, 72);
labelDeleteTime.Name = "labelDeleteTime";
labelDeleteTime.Size = new Size(32, 15);
labelDeleteTime.Size = new Size(202, 15);
labelDeleteTime.TabIndex = 29;
labelDeleteTime.Text = "0 ms";
labelDeleteTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelReadTime
//
labelReadTime.AutoSize = true;
labelReadTime.Location = new Point(376, 43);
labelReadTime.Name = "labelReadTime";
labelReadTime.Size = new Size(32, 15);
labelReadTime.Size = new Size(202, 15);
labelReadTime.TabIndex = 28;
labelReadTime.Text = "0 ms";
labelReadTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// labelInsertTime
//
labelInsertTime.AutoSize = true;
labelInsertTime.Location = new Point(376, 14);
labelInsertTime.Name = "labelInsertTime";
labelInsertTime.Size = new Size(32, 15);
labelInsertTime.Size = new Size(202, 15);
labelInsertTime.TabIndex = 27;
labelInsertTime.Text = "0 ms";
labelInsertTime.Text = "Total time: 0 ms / Average time: 0 ms";
//
// buttonDelete
//
@ -184,7 +184,7 @@
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(424, 101);
ClientSize = new Size(594, 101);
Controls.Add(labelDeleteTime);
Controls.Add(labelReadTime);
Controls.Add(labelInsertTime);

View File

@ -12,6 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace RouteGuideView
{
@ -48,9 +49,9 @@ namespace RouteGuideView
_transportLogic = transportLogic;
_driverLogic = driverLogic;
numericUpDownInsert.Maximum = 1000;
numericUpDownRead.Maximum = 1000;
numericUpDownDelete.Maximum = 1000;
numericUpDownInsert.Maximum = 10000;
numericUpDownRead.Maximum = 10000;
numericUpDownDelete.Maximum = 10000;
}
/// <summary>
@ -78,7 +79,7 @@ namespace RouteGuideView
DriverId = driverId
};
stopwatch.Start();
stopwatch.Restart();
var operationResult = _transportLogic.Create(model);
if (!operationResult)
{
@ -87,7 +88,7 @@ namespace RouteGuideView
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelInsertTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelInsertTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -111,7 +112,7 @@ namespace RouteGuideView
stopwatch.Start();
_transportLogic.ReadList(entitiesCount);
stopwatch.Stop();
labelReadTime.Text = $"{stopwatch.ElapsedMilliseconds} ms";
labelReadTime.Text = $"Total time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds)} ms / Average time: {Convert.ToInt32(stopwatch.ElapsedMilliseconds / entitiesCount)} ms";
}
catch (Exception ex)
{
@ -135,12 +136,12 @@ namespace RouteGuideView
var stopwatch = new Stopwatch();
for (int i = 1; i <= entitiesCount; i++)
{
stopwatch.Start();
stopwatch.Restart();
_transportLogic.Delete();
stopwatch.Stop();
time += stopwatch.ElapsedMilliseconds;
}
labelDeleteTime.Text = $"{Convert.ToInt32(time / entitiesCount)} ms";
labelDeleteTime.Text = $"Total time: {Convert.ToInt32(time)} ms / Average time: {Convert.ToInt32(time / entitiesCount)} ms";
}
catch (Exception ex)
{