Skip to content

Commit

Permalink
Fix NRE when trying to start the stopwatch (#747)
Browse files Browse the repository at this point in the history
* Fix NRE when trying to start the stopwatch
* Make Stopwatch property threadstatic
  • Loading branch information
rjmholt authored Sep 18, 2018
1 parent 04efac5 commit 8bf5c9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PowerShellEditorServices/Utility/ExecutionTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static ExecutionTimer Start(
[CallerLineNumber] int callerLineNumber = -1)
{
var timer = new ExecutionTimer(logger, message, callerMemberName, callerFilePath, callerLineNumber);
t_stopwatch.Start();
Stopwatch.Start();
return timer;
}

Expand Down Expand Up @@ -93,6 +93,6 @@ public void Dispose()
callerLineNumber: _callerLineNumber);
}

private Stopwatch Stopwatch => t_stopwatch ?? (t_stopwatch = new Stopwatch());
private static Stopwatch Stopwatch => t_stopwatch ?? (t_stopwatch = new Stopwatch());
}
}

0 comments on commit 8bf5c9c

Please sign in to comment.