Tuesday, March 31, 2009

Finding Time duration in C#


We can use TimeSpan for finding Time duration in C#.

(e.g)
//Get starttime
DateTime starttime=DateTime.Now;
//To some task (e.g browse www.qualitypointtech.com)
............
webbrowser1.navigate("www.qualitypointtech.com");
............
//Get endtime
DateTime endtime=DateTime.Now;

//Find the time gap between starttime and endtime.
TimeSpan duration = endtime - starttime
More Articles...

No comments:

Search This Blog