This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Calulate the response Time from a Server  RSS feed

 
chetan raj
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a requirement to calculate the amount of time it take to get a response from a server.
I want to know is there a possibility with any open source api like log4j or any other open source api etc.
using which i can calculate the amount of time it took for a request to get processed.


thanks in advance
Chetan
 
Joe Ess
Bartender
Posts: 9425
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create an instance of URL. Save the system time. Try to read the content (perhaps only one byte from the input stream). Get the system time again. Subtract the first time from the second time. The result is the response time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!