Mail Archives: djgpp/1998/03/07/03:46:43
From: | "Martin Ambuhl" <mambuhl AT tiac DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Speed Test - TC vs. DJGPP
|
Date: | Sat, 7 Mar 1998 03:28:01 -0500
|
Organization: | Honors Bridge Club
|
Lines: | 52
|
Message-ID: | <6dr0br$86r@news-central.tiac.net>
|
References: | <01bd492f$47fb8b40$929175c2 AT ctx>
|
NNTP-Posting-Host: | p0.ts3.newyo.ny.tiac.com
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Adrian Francis wrote in message <01bd492f$47fb8b40$929175c2 AT ctx>...
|Hi,
|
|I tried the following program in TC 3.0 and DJGPP...
Perhaps if you used a long int format (%ld) to print long ints you
would have better results. While you're at it, change main to
(properly) return an int. And add some nice '\n's.
|
|#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!
What a strange expectation!
What is the supposed relationship between the size of an address and
the speed of execution?
-
- Raw text -