Hi, iam executin a query from c# windows application in against sql sever 2005, for this i want to dispaly the time taken to execute the query on the windows form, how to do it please tell me
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Feb 28, 2010, 4:02 AM
about measuring Execution time of code ..
http://www.c-sharpcorner.com/UploadFile/kirtan007/ExecutionTime11032009101252AM/ExecutionTime.aspx?ArticleID=5bf8112c-7c77-4ad1-a0e4-9c142f66dc9d
kiran kumarPosted Feb 28, 2010, 4:09 AM
do like this
DateTime start = DateTime.Now;
//call the database and execute your sqlquery here
DateTime end = DateTime.Now;
TimeSpan duration =end-start;
//put a label and assign the duration to it like this
label1.Text = duration.TotalSeconds.ToString();
MARK THE ANSWER IF IT HELPS YOU