R
Ross
I'm a newbie at this, and have searched a lot but can't find something
that seems appropriate for measuring a recurring elapsed time.
Creating an object with: var mydate = new Date(); seems clear, as is
creating a second: nowTime = new Date(); and getting a difference
between the two.
My quesiton is what if you have many, maybe thousands of intervals you
wish to measure? Should I do: nowTime = new Date(); with every pass
of a loop, maybe thousands of times?
For example, if I wish download thousands of messages from a server and
report the average elapsed time, would I create a new Date() object
every time through a loop? Would you constantly assign the same var to
new Date() objects?
If so, is that some issue in javascript, maybe creating a memory leak or
needing some sort of garbage collection?
Or, when I say myTime = new Date() it takes the current date. Is there
no reset method to tell that object to reset again, like...
myTime.ResetThis() //does something like this exist?
Thanks...
Ross.
that seems appropriate for measuring a recurring elapsed time.
Creating an object with: var mydate = new Date(); seems clear, as is
creating a second: nowTime = new Date(); and getting a difference
between the two.
My quesiton is what if you have many, maybe thousands of intervals you
wish to measure? Should I do: nowTime = new Date(); with every pass
of a loop, maybe thousands of times?
For example, if I wish download thousands of messages from a server and
report the average elapsed time, would I create a new Date() object
every time through a loop? Would you constantly assign the same var to
new Date() objects?
If so, is that some issue in javascript, maybe creating a memory leak or
needing some sort of garbage collection?
Or, when I say myTime = new Date() it takes the current date. Is there
no reset method to tell that object to reset again, like...
myTime.ResetThis() //does something like this exist?
Thanks...
Ross.