计算机测速小程序

Author: 刘友生 Date: 1997-01-01

  REM 编程语言:QBASIC
  KEY OFF:CLS
  LOCATE 3,18:INPUT "请输入测试时间:";T
  t1$=TIME$
  time1=VAL(MID$(t1$,1,2))*3600+VAL(MID$(t1$,4,2))*60+VAL(MID$(t1$,7,2))
  FOR i=1 TO 500000000   
  t2$=TIME$   
  time2=VAL(MID$(t2$,1,2))*3600+VAL(MID$(t2$,4,2))*60+VAL(MID$(t2$,7,2))   
  LOCATE 5,18:   
  ZC=time2-time1   
  PRINT INT(ZC/60);"分";ZC MOD 60;"秒"   
  IF ZC=T THEN      
  LOCATE 7,18:PRINT INT(i*18/ZC);"次/每秒运行":EXIT FOR   
  END IF
  NEXT i
  END