Re: Timer on webpages
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Timer on webpages

From: Randy Webb <HikksNotAtHome@aol.com>
Date: Sun Apr 30 2006 - 02:56:16 CEST

Dr John Stockton said the following on 4/29/2006 5:25 PM:
> JRS: In article <mM2dnd6tB8szLM7ZnZ2dnUVZ_vidnZ2d@comcast.com>, dated
> Sat, 29 Apr 2006 14:34:28 remote, seen in news:comp.lang.javascript,
> Randy Webb <HikksNotAtHome@aol.com> 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/
Received on Mon May 1 05:27:27 2006