Re: Timer on webpages
- From: Randy Webb <HikksNotAtHome@xxxxxxx>
- Date: Sat, 29 Apr 2006 20:56:16 -0400
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/
.
- Follow-Ups:
- Re: Timer on webpages
- From: RobG
- Re: Timer on webpages
- References:
- Timer on webpages
- From: David
- Re: Timer on webpages
- From: Ben C
- Re: Timer on webpages
- From: Randy Webb
- Re: Timer on webpages
- From: Dr John Stockton
- Timer on webpages
- Prev by Date: Re: Problem with window.open
- Next by Date: Re: Disable Paste and Drag event
- Previous by thread: Re: Timer on webpages
- Next by thread: Re: Timer on webpages
- Index(es):
Relevant Pages
|