Jun 13, '05 09:16:00AM • Contributed by: CraigStanton
I really like the World Clock (now that I have edited it to show the date, too), but I was asked to find a way to cut down on it's CPU usage. What I came up with was disabling the little red second hand.
First of all you'll need to open World Clock (Control-click on it in /Library/Widgets and choose Show Package Contents). Find WorldClock.js and open it with your favorite pure text editor. Find the following lines in the file:
context.rotate (secondsAngle);
context.translate (-3.5,-50.5);
context.drawImage (sechand, 0, 0, 7, 55);
and comment them out by puttting // at the start of each line, or /* before the first and */ after the last). That takes care of drawing the hand. Now change this line to stop it from calculating the sway of the second hand.
timerInterval = setInterval("updateTime(true);", 1000);
to
timerInterval = setInterval("updateTime(false);", 1000);
You could also change that 1000 to something higher. It sets the number of milliseconds between each time it recalculates the time and the angles that each hand is drawn at. A higher number will mean it changes the time less often (saving CPU). When done, save the changes, quit the editor, and then close (if it was open) and re-open the widget.
