This commit is contained in:
2020-02-13 17:19:45 +01:00
parent a6ac1e08f0
commit 73bfb00299
15 changed files with 2102 additions and 1164 deletions

View File

@@ -221,5 +221,44 @@ Public Class RefreshHelper
End Try
End Sub
Public Class SW
Public label As String
Public stopwatch As Stopwatch
Public Sub New(label As String)
Me.label = label
stopwatch = New Stopwatch()
stopwatch.Start()
End Sub
Public Function Done() As Long
If LOGCONFIG.Debug = False Then
Return 0
End If
stopwatch.Stop()
Dim ts As TimeSpan = stopwatch.Elapsed
Dim timespan_ = String.Format("{0:00}:{1:00}.{2:00}", ts.Minutes, ts.Seconds, ts.Milliseconds / 10)
If ts.Minutes > 0 Then
timespan_ = String.Format("{0:00}:{1:00}.{2:00}", ts.Minutes, ts.Seconds, ts.Milliseconds / 10)
ElseIf ts.Seconds > 0 And (ts.Minutes > 0) = False Then
timespan_ = String.Format("{0:00}.{1:00} seconds", ts.Seconds, ts.Milliseconds / 10)
ElseIf (ts.Seconds > 0) = False And ts.Milliseconds > 0 Then
timespan_ = String.Format("{0:00}.{1:00} seconds", ts.Seconds, ts.Milliseconds / 10)
End If
If timespan_ <> "00:00.00" Then
Dim message = String.Format("{0} || {1}", timespan_, label)
If LOGCONFIG.Debug = True Then
LOGGER.Debug(message)
End If
End If
Return stopwatch.ElapsedMilliseconds
End Function
End Class
End Class