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: Dr John Stockton <jrs@merlyn.demon.co.uk>
Date: Sat Apr 29 2006 - 23:25:34 CEST

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.

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

-- 
 © John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v4.00   MIME. ©
 Web  <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
 Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Received on Mon May 1 05:27:16 2006