PUTCH.C
上传用户:qq5388545
上传日期:2022-07-04
资源大小:29849k
文件大小:1k
- #include <stdio.h>
- #include <conio.h>
- #include <time.h>
- void main(void)
- {
- int letter;
- int count;
- time_t start_time, stop_time;
-
- time(&start_time);
- for (count = 0; count < 1000; count++)
- for (letter = 'A'; letter <= 'Z'; letter++)
- putchar(letter);
- time(&stop_time);
- printf("nnTime required for putchar %d secondsn",
- stop_time-start_time);
- printf("Press any key...n");
- getch();
- time(&start_time);
- for (count = 0; count < 1000; count++)
- for (letter = 'A'; letter <= 'Z'; letter++)
- putch(letter);
- time(&stop_time);
- printf("nnTime required for putch %d secondsn",
- stop_time-start_time);
- }