Code:
- #include <time.h>
- #include <stdio.h>
- #include <decimal.h>
-
- void main ( ) {
- time_t startTime, endTime;
- decimal(11,0) jx, ix, bx, loopCx ;
-
- loopCx = 500000 ;
- jx = 0 ;
- time(&startTime);
- for (bx = 1 ; bx <= 20 ; ++bx) {
- for (ix = 1 ; ix <= loopCx ; ++ix ) {
- jx += ix ;
- if (jx > 4500000)
- jx = 0 ;
- }
- }
- time(&endTime);
- printf("Started at %s\n", asctime(gmtime(&startTime)));
- printf("Ended at %s\n", asctime(gmtime(&endTime)));
- printf("... Press Enter to exit program ...\n");
- fflush(stdin);
- getchar();
- }
-
-
|
|