01-25-2007, 02:26 AM
I was just thinking that, if a program can detect the computer speed for the computer it is running on, we could just use that value as part of our short program pauses, so that the pause time would be the same length of real time, no matter the particular speed of the computer in use. For instance, if my computer clock speed = 3GHx, I could write use it for a program, like this:
So, is it possible - and fairly easy - to detect the computer's clock speed? If so, how?
Code:
CLS
SCREEN 13
'LIGHTNING
CS = 3 'clock speed, in MHz
T = 30000*CS 'a short time
bg = 0 'clock speed, in MHz
FOR I= 1 TO 20
LINE (0,0)-(319.199),15,BF 'show the screen as bright white
FOR J = 1 TO T:NEXT J 'short pause
LINE(0,0)-(319,199),bg,BF 'show the screen with the bg color
FOR J = 1 TO T:NEXT J 'short pause
NEXT I
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.