private void btnMirror_Click(object sender, EventArgs e) { btnMirror.Enabled = false; var imgInput = new Bitmap(picInput.Image); var frameMirrorService = new FrameMirrorService(); var stopWatch = new Stopwatch(); //Start counting from beginning of the logic stopWatch.Start(); var response = frameMirrorService.MirrorImage(imgInput); //Stop counting until last millisecond stopWatch.Stop(); ShowResults(response, stopWatch.ElapsedMilliseconds); btnMirror.Enabled = true; }