delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/06/18:00:32

From: "Adrian Francis" <adrian DOT francis AT cableinet DOT co DOT uk>
Subject: Speed Test - TC vs. DJGPP
Newsgroups: comp.os.msdos.djgpp
Message-ID: <01bd492f$47fb8b40$929175c2@ctx>
NNTP-Posting-Host: usr136-wol.cableinet.co.uk
Date: 6 Mar 98 18:53:54 GMT
Organization: "Cable Internet (post doesn't reflect views of Cable Internet)"
Lines: 39
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

I tried the following program in TC 3.0 and DJGPP...

#include <time.h>

void sub(void)
{
}

void main(void)
{
clock_t start,end;
long n,time;

clrscr();
start=clock();
for (n=0;n<1000000;n++)
{
sub();
}
end=clock();
time=(end-start);
printf("tics:%d",time);
time/=CLOCKS_PER_SEC;
printf("sec:%d",time);
}

...and got these results...

DJGPP - 	tics:13345	sec:146
TC - 		tics:5		sec:0

Can someone explain why this is happening?  I would expect DJGPP to be
twice as fast considering it is a 32bit compiler.  Something must be wrong!

Thanks!

-ADRIAN-

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019