Sathish David Kumar N
asked on
how to calculate popup window timing
HI ,
I have course link , if i press any course then one popup will open , that time i want to calculate the timing how much time the popup window is open ? how to do that ??
I have course link , if i press any course then one popup will open , that time i want to calculate the timing how much time the popup window is open ? how to do that ??
Have var starttime and endtime globally declared.
In the document.onload method set the current time to starttime.
In the window.onbeforeunload method have a function. In that function set the current time to endtime. Find the time difference (endtime - starttime). This is the duration to calculate the open time of the window.
In the document.onload method set the current time to starttime.
In the window.onbeforeunload method have a function. In that function set the current time to endtime. Find the time difference (endtime - starttime). This is the duration to calculate the open time of the window.
ASKER
Can ypu give some sample code??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@EaswaranP: i am asking for popup winodow time calulcation
The Main in the question is
1. Calculate time how much time the popup is open ?
The Main in the question is
1. Calculate time how much time the popup is open ?
Thats what my answer for. Have you tried that? What are you getting?
ASKER
Not get full solution
Problems with this idea:
-Executing a function each milisecond, although a simple one like this, is not a good idea for performance.
-Also the execution of the own function will delay the counter, under client computer load maybe even one call to the function may arise before the last one finishes.
I don't understand why do you want to control this. A pop-up opening will be always called in the less time possible and it will be dependant on the client machine load and capabilities, so seems quite pointless to me to measure this time.