home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / gle / gle / ptime.c < prev    next >
C/C++ Source or Header  |  1992-11-29  |  874b  |  41 lines

  1. #include <stdio.h>
  2. #include <jpidef.h>
  3. struct item_struct           /* structure for use during calls to SYS$GETUAI */
  4.   {
  5.   short len;                 /* specifies length of buffer for SYS$GETUAI call */
  6.   short code;                /* specifies item of information returned from SYS$GETUAI */
  7.   long *addr;                /* address of buffer used in SYS$GETUAI call */
  8.   long *rlen;                /* address of word which holds length of information returned */
  9.   };
  10. struct item_struct itmlst[2];  /* define itmlst which holds parameters passed to SYS$GETUAI call */
  11. ptime ()
  12. {
  13.     int st; int xxx;
  14.     static lastcpu;
  15.     long cputime;
  16.     itmlst[0].len = 4;
  17.     itmlst[0].code = JPI$_CPUTIM;
  18.     itmlst[0].addr = &cputime;
  19.     itmlst[0].rlen = &xxx;
  20.     st = SYS$GETJPI(0,0,0,itmlst,0,0,0);
  21.     gprint("==CPUtime %d   diff=%d \n",cputime,cputime-lastcpu);
  22.     lastcpu = cputime;
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.