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: Ben C <spamspam@spam.eggs>
Date: Sat Apr 29 2006 - 17:53:41 CEST

On 2006-04-29, David <david.goodyear@gmail.com> wrote:
> Hi,
>
> Im not sure where to find all the documentation i need for this? I need
> to timer since a start button has been pushed, and show a counter on a
> page. If they click stop i want to keep the time, and carry on
> incrementing it if they click start again.
>
> Any suggestions on code, or reference material for this?

Tricky one. I can't think of a way except using setInterval, with an
interval of about a second. In the callback you update the counter,
animation, etc., and increment a variable that counts how many seconds have
elapsed.
Received on Mon May 1 05:26:53 2006