tags:

views:

37

answers:

1

Is there any method to capture the time taken from the alert message displayed till the users action to confirm the message using javascript

A: 

Start a timer in Javascript when you display the message. Stop the timer when the user acknowledges the message. Use AJAX to submit the time to your PHP/CodeIgniter app.

Start a timer when you are going to ask a question on StackOverflow. Don't submit questions that take less than 5 seconds to write.

Finbarr
Thanks you gave me the clue.Here's the clue,<code> var timer = { time: 0, now: function(){ return (new Date()).getTime(); }, start: function(){ this.time = this.now(); }, since: function(){ return this.now()-this.time; } } timer.start(); // start counting my friend... /* do some amazing stuff with jQuery or any other JavaScript library */ alert('I did all that in ' + timer.since() + 'ms');
ASD