Category : OS/2 Files
Archive   : VIDTEST.ZIP
Filename : VIDTEST.C

 
Output of file : VIDTEST.C contained in archive : VIDTEST.ZIP

/*

Vidtest.c

A rough benchmark on VIO performance

*/

#define INCL_NOPM
#define INCL_VIO
#define INCL_DOSINFOSEG

#include
#include
#include


char *mssg1 = "This is a test of the VioWrtCharStr call";
char *mssg2 = "This is a test for VioWrtTTY\r\n";


void main(void)
{
SEL selGDT,selLDT;
GINFOSEG far *pGDT;
ULONG time1,time2,time3;
USHORT len,i;

/* get GDT so we can get time */
DosGetInfoSeg(&selGDT,&selLDT);
pGDT = MAKEPGINFOSEG(selGDT);

/* benchmark VioWrtCharStr */
len = strlen(mssg1);
time1 = 0;
while(time1 != pGDT->msecs) time1 = pGDT->msecs; /* get time in msec */
for (i = 0; i<1000; i++)
VioWrtCharStr(mssg1,len,0,0,0);

/* benchmark VioWrtTTY */
time2 = 0;
len = strlen(mssg2);
while(time2 != pGDT->msecs) time2 = pGDT->msecs;
for (i = 0; i< 1000;i++)
VioWrtTTY(mssg2,len,0);
time3 = 0;
while(time3 != pGDT->msecs) time3 = pGDT->msecs;


/* print out results */
printf("\n\nBenchmark results:");
printf("\n\tVioWrtCharStr:\t%ld msec",time2-time1);
printf("\n\tVioWrtTTY: \t%ld msec",time3-time2);
printf("\n\nEffective throughput:");
printf("\n\tVioWrtCharStr:\t%.0f baud",strlen(mssg1)*8.0E6/(time2-time1));
printf("\n\tVioWrtTTY: \t%.0f baud",strlen(mssg2)*8.0E6/(time3-time2));


}


  3 Responses to “Category : OS/2 Files
Archive   : VIDTEST.ZIP
Filename : VIDTEST.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/