<a onclick="javascript:submitForm('save.htm');">
<span>Save</span></a>
In the above code when i click on save
I want to store the time taken by the save.htm action to to save all the inputs.
Kindly help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The code snippet that you provide shows that the code is invoked from the Javascript within the browser. The browser will submit the form.
If you want to see how long it takes to process the save from the client perspective which include the submission time back and fro from the browser, you just need to add alerts that display the time.
For debugging purpose, for example you can do this:
You can create some fancy Javascript code to put the result in proper place instead of using alert dialog box.
On the other hand, if you want to know what exactly it took to process at the server side, the one who should log is the “save.htm” page, which should print the starting and the stop time, and you can also calculate the difference between them.
For example, the simplest (not recommended for production) would be adding this scriptlet into your JSP where save.htm is processing (assuming “save.htm” is a JSP, not a controller class):