0

I'm using $.ajax() to load the content from a file on the same server and I want to calculate how long time it takes for the content to load. For example, the visitor clicks on a link and a timer starts. When the page have loaded completely, the timer stops and return the results.

How can I accomplish this?

Airikr
  • 6,258
  • 15
  • 59
  • 110
  • 1
    Related: http://stackoverflow.com/questions/313893/how-to-measure-time-taken-by-a-function-to-execute – Cᴏʀʏ Nov 13 '13 at 22:52
  • So this question have been asked and answered before? Oops! My fault. I didn't find anything after I wrote the subject for this question. – Airikr Nov 13 '13 at 22:58
  • The javascript console is a far better place to look than trying to calculate it yourself. – Kevin B Nov 13 '13 at 23:00
  • I'm creating a simpler log system using the console in the web browser, so even the newbie can understand them – Airikr Nov 13 '13 at 23:04
  • @ErikEdgren: Your question is about a specific timing use case, but the question I linked is merely about calculating the time, so I didn't vote to close as duplicate, just thought I would point you at the other question. – Cᴏʀʏ Nov 13 '13 at 23:05
  • Right, but if you want real information on it, you're going to need to know more than just how long the whole request took. For example, there's the time it took to connect to the server, the delay before the server began returning data, how long it took to receive the data, etc. the console already gives all of that information in an easy to read graph. – Kevin B Nov 13 '13 at 23:06
  • @KevinB: Ok but I don't need so detailed information. Besides, the information that are already there, is in English. I want to have 100% Swedish language on my website :) – Airikr Nov 13 '13 at 23:08

0 Answers0