Click to See Complete Forum and Search --> : [timer]


_Arno_
10-08-2003, 02:03 AM
got this script running:

function ZetTijd()
{
Today = new Date();
uren = Today.getHours();
minuten = Today.getMinutes();
seconden = Today.getSeconds();
if (uren <= 9) uren = "0" + uren;
if (minuten <= 9) minuten = "0" + minuten;
if (seconden <= 9) seconden = "0" + seconden;
clocktext = uren + ":" + minuten + ":" + seconden;
document.getElementById("Timer").innerHTML = clocktext;
clocktimer = setTimeout("ZetTijd()", 1000);
}


just an easy timer wich should update the span every second.
It works as it should
but only one down side
When i run the script and go on my website , it will keep my processor on 10/15 % all the time
wich i think is a bit much for just a timer on a amd 2ghz
is there anyway to improve my timer to keep processor speed low?:confused:

*checked processor % with taskmanager xp pro*

Gollum
10-08-2003, 06:07 AM
odd, I tried it out on my 3yr old 866Mhz computer (NT4) and it used 0% (or close to) of the CPU time.

I think there is something else chewing up your CPU

_Arno_
10-08-2003, 07:33 AM
that timer ? are u sure , cause if i delete that script from my website , the processor sticks to 0/2%

Check it on my website and see what happens ,www.van-rossum.com (http://www.van-rossum.com)

really bizzare.
and frustrating
couldnt it be cause i used <span> ?