Forums Register Login

How can we know what is the execution time taken for completing a Operation

+Pie Number of slices to send: Send
Hi ,

How can i know what is the execution time taken for completing an operation .
My query is that for example I am fetching data from DataBase and it can be done using Statements and PreperaedStatements also know , so i want to know what is the time taken when using Statements and what time in case of PreparedStatements .

Please let me know is there any tool for this .

+Pie Number of slices to send: Send
You can check the system time at the start and the end of the method and look at the difference.
+Pie Number of slices to send: Send
Thank you .

But i want to see all these on tools .

so is any tool like this .
+Pie Number of slices to send: Send
Oh, you want a Java profiling tool! Let me google that for you: java profiler. Hmm, I did not see VisualVM mentioned in the results (I probably missed it).
+Pie Number of slices to send: Send
And there are the logging database drivers (mysql driver has this built-in, or you can use p6spy).
+Pie Number of slices to send: Send
You can always use the getTime() method of the Date class. This can be used as a quick and dirty millisecond timer. it returns a value of type long. So taking two measurements and substracting the first from the second gives you elapsed time in milliseconds.

It's not a replacement for a proper profiling tool I guess. Just a quick and easy time check.
+Pie Number of slices to send: Send
The JAMon sql proxy drive sits in front of the actual db driver and times all queries and other aspects of jdbc.

http://jamonapi.sourceforge.net/#WhatsNew22
I AM MIGHTY! Especially when I hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1356 times.
Similar Threads
Query Execution Time.
Connection.close hangs
Calculating Time taken by a code segment
To Lynn Beighley : What are the most common mistakes developers do ?
Performance meseaurement of code conatining queries
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:47:09.