Currently my code is decorated with a lot of code like this:
Stopwatch stopWatch = new Stopwatch(); stopWatch.Start();
InitializeComponent();
stopWatch.Stop(); App.CoHomeMSecs = stopWatch.ElapsedMilliseconds;
Although I realize there's not much code here is there any way I could reduce the code associated with initializing the stopwatch, starting, stopping and setting the value.
For example, could I put the process into a method that returned the milliseconds and that took a block of code as an argument?