Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clock speed?
#1
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:
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
So, is it possible - and fairly easy - to detect the computer's clock speed? If so, how?
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Messages In This Thread
Clock speed? - by Ralph - 01-25-2007, 02:26 AM
Clock speed? - by DrV - 01-25-2007, 06:23 AM
Clock speed? - by Ralph - 01-25-2007, 08:10 AM
Clock speed? - by nkk_kan - 01-25-2007, 06:32 PM
Clock speed? - by DrV - 01-25-2007, 10:32 PM
Clock speed? - by Ralph - 01-26-2007, 01:46 AM
Clock speed? - by Dinosaur - 01-26-2007, 04:10 AM
Clock speed? - by Ralph - 01-26-2007, 09:29 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)