Mail Archives: djgpp/1998/03/06/15:15:41
And his code is accessing the RTC via BIOS so there are lots of context
switches. Stay out of real mode and you won't see this overhead.
John Welter
MCSE, Systems Engineer
North West Group
Patrick Griffiths wrote in message <35004EAB DOT 89131229 AT po-box DOT mcgill DOT ca>...
>I think it's because:
>djgpp goes has to do a lot of extra work to
>operate in protected mode, that is why the
>executables tend to be somewhat larger.
>
>Patrick
>
>Adrian Francis wrote:
>
>> 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 -