Pankil Agrawal
Pankil Agrawal

Reputation: 101

how to check time taken by application to submit data in database in .net

I want to check/find time taken by application to submit data in database when user click on submit button. I want to check my various code to insert data into database & find the fastest code of mine. So please help me.

Upvotes: 1

Views: 267

Answers (2)

Nadeem_MK
Nadeem_MK

Reputation: 7689

Microsoft SQL Server Profiler can help to SQL Trace for monitoring an instance of the Database Engine or Analysis Services.

You can capture and save data about each event to a file or table to analyze later. For example, you can monitor a production environment to see which stored procedures are affecting performance by executing too slowly.

For more details about how to use it, check this link or this video.

Upvotes: 2

Adil
Adil

Reputation: 148120

You can use stopwatch to calculate the time taken to save data.

Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();

 //Code to save data 

 stopWatch.Stop();

 TimeSpan ts = stopWatch.Elapsed;

Upvotes: 2

Related Questions