Hello Sander
On Friday, 29 December 1995 18:33:00, you wrote to All:
SS> Check this source, and let it run on your computer... It will
SS> do some read/write operations, and give the delayed time..
SS> First try with X% and therafter remove the % from all the
SS> FOR/NEXT lines. When the % charz are present, the program runs so
SS> fast, that it ends before the timer changes. When the % charz are
SS> removed, it slows down to more than 90%!!
SS> Can somebody explain me why this is,
With % the loop counting variables are integers, without them they
are single precision floating point variables. Working with integers
is much faster than working with floating point variables.
It's a bit strange that in basic the default variable type is single
precision floating point. Integer would be much better in most
cases. You can make integer the default type by beginning your code
with the statement DEFINT A-Z.
SS> and if there is a way to do it faster?
No.
Regards,
Hans Lunsing
Leiden, The Netherlands
Fido : 2:281/607.214, 2:282/610.12
Internet : jlunsing@doge.nl
--- Terminate 3.00/Pro
(2:281/607.214)
---------------
* Origin: The Animal Farm For BASIC Programmers! ++31793512523
|