private void btnHuffman_Click(object sender, EventArgs e) { Stopwatch s = new Stopwatch(); s.Start(); if (ImageMatrix != null) { ImageOperations.Huffman_Code(ref ImageMatrix); } else { MessageBox.Show(" Open Image "); } s.Stop(); txtTime.Text = Convert.ToString(s.Elapsed); }