This tells how to calculate elapsed time. Looks simpler than the code you shared.
https://msdn.microsoft.com/en-us/library/aa239571(v=vs.60).aspx>The code provided references an array.
>
>In that code, it is not about getting new content from the server but to actualize the time stamps of active content on the page.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer