Re: Timer on webpages



Dr John Stockton said the following on 4/29/2006 5:25 PM:
JRS: In article <mM2dnd6tB8szLM7ZnZ2dnUVZ_vidnZ2d@xxxxxxxxxxx>, dated
Sat, 29 Apr 2006 14:34:28 remote, seen in news:comp.lang.javascript,
Randy Webb <HikksNotAtHome@xxxxxxx> posted :
In the callback you update the counter, animation, etc., and increment a variable that counts how many seconds have elapsed.
I don't agree with that one. Incrementing a variable would lead to inaccuracies in the total. Just start with a Date object and compare the current time, get the difference, and display it.

Using a Date Object to indicate duration will be unreliable in systems
where the clock is being automatically synchronised from time to time.

If your app is that time critical, then you would know whether that was happening or not and if you didn't allow for it then you get what you deserve.

Using a Date Object naively to indicate duration will be unreliable when
the season changes between Summer and Winter.

And naively assuming that most business applications are being used on a Saturday night at 2AM is indeed naive.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.



Relevant Pages

  • Re: Timer on webpages
    ... Dr John Stockton said the following on 4/30/2006 5:50 PM: ... Randy Webb posted: ... And naively assuming that most business applications are being used on a Saturday night at 2AM is indeed naive. ... If your app is that time critical, then you would know whether that was happening or not and if you didn't allow for it then you get what you deserve. ...
    (comp.lang.javascript)
  • Re: Timer on webpages
    ... Randy Webb posted: ... increment a variable that counts how many seconds have elapsed. ... If your app is that time critical, then you would know whether that was happening or not and if you didn't allow for it then you get what you deserve. ... process have shift work. ...
    (comp.lang.javascript)
  • Re: Firefox and Page Events
    ... In my app I have code to increment a counter and write an event each ... As a result, my counters are wrong, and my event log is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Firefox and Page Events
    ... In my app I have code to increment a counter and write an event each ... As a result, my counters are wrong, and my event log is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Users Counter
    ... increment, decrement y new como instrucción" ... >> I dont have a SignOut button on my App because users never press it, ...
    (microsoft.public.dotnet.framework.aspnet)