Fix: CBenchmark.Begin() with CBenchmark.End() throws an exception

This commit is contained in:
lukeIam committed 2018-03-31 18:24:20 +02:00
1 parent 8d54dd869f
commit 449f6ee833
1 file changed
+2 -2
+2 -2
View File
@@ -61,10 +61,10 @@ namespace VocaluxeLib.Log
/// Stops this benchmark. /// Stops this benchmark.
/// </summary> /// </summary>
/// <param name="success">If true a success message will be added to the log otherwise a message for failure.</param> /// <param name="success">If true a success message will be added to the log otherwise a message for failure.</param>
public void Stop(bool success = true) public void Stop(bool success = true)
{ {
if (_Watch == null) if (_Watch == null)
throw new InvalidOperationException("Timer is not running."); return;
_Watch.Stop(); _Watch.Stop();
double duration = _GetElapsedTime(_Watch); double duration = _GetElapsedTime(_Watch);