I must say, I'm very disappointed with Turbo Pascal on the Amstrad. I've
written around 3 programs now, which clearly demonstrate it's downfalls
when up against the Amstrad's Standard interpreted BASIC.
I wrote a simple BASIC program, which counts from 0 to 100 & displays
the cosine of that (this was 1 figure stuff with 9 decimal placings),
this test took 6secs to do in Locomotive BASIC. An equivalant Turbo
Pascal program took 11Secs. I modified my TP program so it would only
display 5 decimal spots, but still took 9secs! :-(
I'll have one last test to do with this TP & if I see no improvement,
then I'm kicking in on this system because it just seems to be crazy to
have a compiler been beaten by an interpreted language.
If anyone wants a report on this language done for their fanzine, let me
know & I'll put in my 2 cents!
Cheers,
Ross.
pascal.
var
a,b : integer;
for a:=1 to 1000000 do
begin
b:=b+1;
end;
"Ross Simpson" <Hi_Mr_...@nowhere.com.au> wrote in message
news:3fb085b6$0$9403$afc3...@news.optusnet.com.au...
> 10 int a,b
> 20 for a=1 to 1000000
> 25 b=b+1
> 30 next
>
> pascal.
> var
> a,b : integer;
> for a:=1 to 1000000 do
> begin
> b:=b+1;
> end;
>
Oups !
If a and b are integers, you have -32768=<a=<32767, i guess...
Régis
> <lurk mode off>
> seems a bit odd...
> maybe the pascal compiler is no good at floating point
> how does it benchmark using integer variables only..ie..
Actually in Turbo Pascal, isn't too bad, in Locomotive BASIC it's
actually slower, unless 'defint c' (c for count) there, in which case
is the same speed as TP.
> basic.
> 10 int a,b
> 20 for a=1 to 1000000
> 25 b=b+1
> 30 next
> pascal.
> var
> a,b : integer;
> for a:=1 to 1000000 do
> begin
> b:=b+1;
> end;
I've reworked on one of my programs, by rewriting the loop & working
out (as an integer) how many time .2 goes into 125.8, which returned
629 times. From there I used a for loop (with count :=0 to 629), but
it hasn't made a difference. I can only image that the sin & cos in
Pascal is taking more time to calculate the result (maybe not a lot of
time difference), but because of it takes 629 steps to complete the
program, it all blows out time.
Cheers,
Ross.