home *** CD-ROM | disk | FTP | other *** search
- /*
-
- POSIX CLIENT TO TIME RPC REQUESTS
-
- (C) Copyright 1992 by
-
- John Richardson
- CompuServe 70541,672
- Internet jr@sni-usa.com
-
- This program may be used freely provided that this copyright is
- included in the source listings.
-
-
- This is an example client program that times how long it takes to
- do a NULL RPC to the WIN32 server.
- */
-
- #include <unistd.h>
- #include <stdio.h>
- #include <fcntl.h>
- #include <string.h>
- #include <stdlib.h>
- #include "win32psx.h"
-
- extern int errno;
-
-
- main(int ac, char **av)
- {
- time_t begintime, endtime, deltatime;
- int count, NCOUNT;
-
- if(ac == 1) NCOUNT = 100;
- else
- {
- NCOUNT = atoi(av[1]);
- }
- printf("Doing %d loops...\n",NCOUNT);
-
- /* Attach to the POSIX server that is our gateway to WIN32 */
- AttachToServer();
-
- begintime = time((time_t *) 0);
- /* Send the Noop RPC to the WIN32 Server */
-
- for(count=0; count <NCOUNT; count++)
- {
- NoopRPC();
- }
- endtime = time((time_t *) 0);
- deltatime = endtime - begintime;
- printf("Total time %d\n",deltatime);
- if(deltatime)
- printf("Did %d RPC's/Sec\n",NCOUNT/deltatime);
-
- return(0);
- }
-