I am trying to download a file from the server and want to calculate the time taken for that particular download and display it. Below is the code which is used to download but I am finding difficulty in calculating the time and displaying it. Important point is I might end up running the code several times on one click, I mean, the code should run for few times, say 15 times and I need to calculate time for every iteration and should display all the values to the user. Can anyone please help me in this? I am new to programming that’s why I might be asking very silly doubts but please don’t mind.
<html>
<head>
<script src="jQuery.js"></script>
<script type="text/javascript">
$.ajax({
url: "input.txt",
})
.done(function(data){
$("#textResponse").val(data);
})
</script>
</head>
<body>
<textarea rows="50" cols="90" id="textResponse"></textarea>
</body>
</html>