Advertisement
Ham62

SpeedTest.bas

Mar 8th, 2016
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 1.70 KB | None | 0 0
  1. DECLARE SUB DrawString (X%, Y%, C%, S$)
  2. DEFINT A-Z
  3. REM $INCLUDE: 'qbx.bi'
  4.  
  5. SCREEN 13
  6.  
  7. DIM lCalls AS LONG, lChars AS LONG
  8.  
  9. sText$ = "?"
  10. fCalls! = TIMER
  11. DO
  12.   iX = RND * 312: iY = RND * 191: iC = RND * 255
  13.   DrawString iX, iY, iC, sText$
  14.   DrawString iX, iY, iC, sText$
  15.   DrawString iX, iY, iC, sText$
  16.   lCalls = lCalls + 3
  17. LOOP UNTIL ABS(TIMER - fCalls!) >= 3
  18.  
  19. sText$ = CHR$(1) + " Hello World " + CHR$(1)
  20. fChars! = TIMER
  21. DO
  22.   iX = RND * 312: iY = RND * 188: iC = RND * 255
  23.   DrawString iX, iY, iC, sText$
  24.   DrawString iX, iY, iC, sText$
  25.   DrawString iX, iY, iC, sText$
  26.   lChars = lChars + 3
  27. LOOP UNTIL ABS(TIMER - fChars!) >= 3
  28.  
  29. LOCATE 1, 1
  30. PRINT "Calls/s = "; lCalls \ 3
  31. PRINT "Chars/s = "; (lChars * LEN(sText$)) \ 3
  32.  
  33. SLEEP
  34.  
  35. SUB DrawString (X%, Y%, C%, S$) STATIC
  36.   IF iInit = 0 THEN
  37.     iInit = 1
  38.     REDIM ASM(36) AS LONG
  39. ASM(0)=&H1E0660CC
  40. ASM(1)=&HB71130B8
  41. ASM(2)=&H8C10CD03
  42. ASM(3)=&H89C08EC0
  43. ASM(4)=&H8BE589EE
  44. ASM(5)=&HC2692256
  45. ASM(6)=&H46030140
  46. ASM(7)=&HB8C78920
  47. ASM(8)=&HD88EA000
  48. ASM(9)=&H8B185E8B
  49. ASM(10)=&H668E1A4E
  50. ASM(11)=&H1E6E8B1C
  51. ASM(12)=&H8A6400B4
  52. ASM(13)=&HE0C10046
  53. ASM(14)=&HC6015603
  54. ASM(15)=&H8A2608B7
  55. ASM(16)=&H7401A804
  56. ASM(17)=&H75D8803
  57. ASM(18)=&H37402A8
  58. ASM(19)=&HA8065D88
  59. ASM(20)=&H88037404
  60. ASM(21)=&H8A8055D
  61. ASM(22)=&H5D880374
  62. ASM(23)=&H7410A804
  63. ASM(24)=&H35D8803
  64. ASM(25)=&H37420A8
  65. ASM(26)=&HA8025D88
  66. ASM(27)=&H88037440
  67. ASM(28)=&H80A8015D
  68. ASM(29)=&H1D880274
  69. ASM(30)=&H40C78146
  70. ASM(31)=&H75CFFE01
  71. ASM(32)=&HEF815EBD
  72. ASM(33)=&HC7830A00
  73. ASM(34)=&H75494508
  74. ASM(35)=&H61071FA3
  75. ASM(36)=&HCB
  76.   END IF
  77.      DEF SEG = VARSEG(ASM(0))
  78.      CALL ABSOLUTE(BYVAL Y%, BYVAL X%, BYVAL SADD(S$), BYVAL SSEG(S$), BYVAL LEN(S$), BYVAL C%, VARPTR(ASM(0)))
  79. END SUB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement