Hi
This is very basic question for many of you people .
Actually take a sample snippet say sum of n natural numbers written using while & for .. i need to know the time took by the console application programs to execute ..
Stopclock class ?? if so n order to use it do i need to add reference some assembly or do i need to write USING ????
hOPE YOU GOT ME
My best Regards
How calculate elapsed time of progarm ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Jan 20, 2014, 10:43 PM EST
add using System.Diagnostics;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
// write your code
stopWatch.Stop();
// Get the elapsed time as a TimeSpan value.
TimeSpan ts = stopWatch.Elapsed;
SUNIL GUTTARank #1,832 · 810 reputationPosted Jan 20, 2014, 11:44 PM EST