Category : Files from Magazines
Archive   : SCBENCH.ZIP
Filename : SCBIGRD.C

 
Output of file : SCBIGRD.C contained in archive : SCBENCH.ZIP
/*
** BYTE Large File Read Benchmark
** Version 1 for 8088/8086/80286/80386
** Feb. 17, 1988
** Written in BYTE Small-C
** Based on Small-C by J.E. Hendrix
**
** Routine times reading of a 1000000 byte file.
**
*/

#include stdio.h

#define BUFSIZ 10000 /* Size of read buffer */
#define LOOPS 100 /* Number of times to read BUFSIZ characters
to get 1000000 bytes read. */
char *rbuff; /* Pointer to read buffer */
int tblock[4]; /* Timer block */

main()
{
int i;
int fd;

/* Announce program */
printf("BYTE Large File Read Benchmark\n\n");

/* Now allocate (if you can) space for the read */
rbuff=malloc(BUFSIZ);
if(rbuff==NULL) {
printf("Not enough memory for rbuff\n");
exit(0);
}

/* Open the file */
fd=fopen("BIGFILE.DAT","r");

/* Turn on the timer */
gtime(tblock);

/* Loop and read the file */
for(i=0;i read(fd,rbuff,BUFSIZ);

/* Turn off timer and close file */
calctim(tblock);
fclose(fd);

/* Report results */
printf("Results: (HH:MM:SS:1/100ths)\n");
printf("Time to read file: %d:%d:%d:%d\n",tblock[0],tblock[1],
tblock[2],tblock[3]);

exit(0);
}



  3 Responses to “Category : Files from Magazines
Archive   : SCBENCH.ZIP
Filename : SCBIGRD.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/