10 REM THIS IS A TEST PROGRAM TO DO
20 REM SIMPLE PERFORMANCE BENCHMARKING
30 REM OF THE PLUS/MINUS FLOATING POINT
40 REM ARITHMETIC IN THE X16.

1000 REM
1010 PRINT "SIMPLE FOR LOOP"
1020 NOW=TIME
1030 FOR I=1 TO 10000
1040 NEXT
1050 PRINT TIME-NOW; "JIFFIES."
1060 PRINT

2000 REM
2010 PRINT "FOR LOOP WITH COUNTER"
2020 NOW=TIME
2030 FOR I=1 TO 10000
2040 J=J+I
2050 NEXT
2060 PRINT TIME-NOW; "JIFFIES."
2070 PRINT J
2080 PRINT

3000 REM
3010 PRINT "FOR LOOP WITH COS CALCULATION"
3020 NOW=TIME
3030 FOR I=1 TO 1000
3040 K=K+COS(I)
3050 NEXT
3060 PRINT TIME-NOW; "JIFFIES."
3070 PRINT K
3080 PRINT

4000 REM
4010 J=1.001
4020 K=1
4030 PRINT "FOR LOOP WITH MULTIPLICATION"
4040 NOW=TIME
4050 FOR I=1 TO 10000
4060 K=K*J
4070 NEXT
4080 PRINT TIME-NOW; "JIFFIES."
4090 PRINT K
4100 PRINT

4200 REM
4210 J=5E-20
4220 K=0
4230 PRINT "FOR LOOP WITH MULTIPLICATION UNDERFLOW"
4240 NOW=TIME
4250 FOR I=1 TO 10000
4260 K=K+J*J
4270 NEXT
4280 PRINT TIME-NOW; "JIFFIES."
4290 PRINT K
4300 PRINT

5000 REM
5010 PRINT "FOR LOOP WITH SQR"
5020 NOW=TIME
5030 FOR I=1 TO 1000
5040 K=K+SQR(I)
5050 NEXT
5060 PRINT TIME-NOW; "JIFFIES."
5070 PRINT K
5080 PRINT

9999 SYS 65535

