_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*
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*