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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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