Wednesday, January 16, 2008

On way to know "How much time your function will take during execution"System.Diagnostics.Stopwatch

System.Diagnostics.Stopwatch is a replacement for what most people probably do to identify the time spent on excecuting a method.

System.Diagnostics.Stopwatch watch=new Stopwatch();
watch.Start();
//body of function
watch.Stop();
showduration.Text = "Time Spent for function body execution" + watch.Elapsed.ToString();

No comments:

Post a Comment