home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
progjrn
/
pj_6_1.arc
/
LISTING5.C
< prev
next >
Wrap
Text File
|
1987-12-28
|
1KB
|
38 lines
/* Trivial example using TIMER macros
* Copyright Frank D. Greco, 1987
* Page 50, Volume 6.1 Programmer's Journal
*/
#include <stdio.h>
#include <process.h>
#include <dos.h>
#include "timer.h"
main(argc,argv)
char **argv;
{
char *bp; /* Ptr to command to be spawned */
unsigned long gettime(); /* Gets clock ticks from MS-DOS */
int value; /* Arbitrary variable */
int i; /* Arbitrary variable */
bp = argv[1];
TIME(spawnvp(P_WAIT, bp, ++argv), bp);
TIME( value = 1 + 3 * 8, "value assign.");
START();
for (i = 15; i--; )
fputs("hello",stdout),fputs(" world", stdout),fputs(" again\n",stdout);
STOP();
PRINT_TIME("puts()");
TIME(
{ int i;
for ( i = 0; i < 300; i++)
putchar('X');
}, "for loop"
);
exit(0); /* Good Housekeeping */
}