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: RobG <rgqld@iinet.net.au>
Date: Sun Apr 30 2006 - 04:54:50 CEST

Randy Webb wrote:
> 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.

Absolutely, so worth mentioning.

>> 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.

That is not naive at all - many businesses that have a production
process have shift work. I've frequently been involved in projects with
24hr shifts, 7 days per week over many months. That is common on
projects such as those that use very expensive CAD equipment, say a
major construction project.

-- 
Rob
Received on Mon May 1 05:27:31 2006