|
From: Per W. <pw...@ia...> - 2002-08-16 13:51:13
|
What should be noted is that your test code doesn't test the speed of the Dev-Cpp++-generated program - which in fact is the MingGW- or Cygwin-genrated - but instead measures the time to process a couple of million bytes of output to standard out. Do you redicrect the output, or is it scrolling in a text window. What size is the text window etc. This kind of programs also notoriosly generates a large percent of system (kernel) time, giving the OS scheduler some extra concerns about how to schedule between this and other programs. /PWM EMA System email: pw...@ia... Per Westermark web: http://iapetus.neab.net Vargvaegen 174B phone: +46 8 410 17 198 S-906 42 Umeaa Sweden On Fri, 16 Aug 2002 mo...@ju... wrote: > Running the program below in Dev-C++, Version 4, took between 209 and 235 > seconds on my system. I don't know why the running times vary, but even > taking the fastest time of 209 seconds, it compares unfavorably with a > similar program compiled (36 seconds) or interpreted (55 seconds) in > QBasic 4 . > > Does Dev-C++ really produce such leisurely code? Or can the program be > speeded up? > > Allan > > // This program prints (1) integers 1 to 1,000,000 > // (2) starting & ending times > //====================================================== > #include <stdio.h> > #include <stdlib.h> > #include <time.h> > > int main(int argc, char *argv[]) > { > struct tm *ptr; > time_t loc_time; > long int x; > > loc_time = time(NULL); > ptr = localtime(&loc_time); > > for (x = 1;x <= 1000000;x++) > printf("%d ",x); > > printf("\nStarting time is "); > printf(asctime(ptr)); > > loc_time = time(NULL); > ptr = localtime(&loc_time); > printf("\nEnding time is "); > printf(asctime(ptr), "\n"); > > system ("PAUSE"); > > return 0; > } > > ________________________________________________________________ > GET INTERNET ACCESS FROM JUNO! > Juno offers FREE or PREMIUM Internet access for less! > Join Juno today! For your FREE software, visit: > http://dl.www.juno.com/get/web/. > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |