home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1816 / test.script < prev   
Encoding:
Text File  |  1990-12-28  |  869 b   |  56 lines

  1. csh> cat test.c
  2. #include "pmplib.h"
  3.  
  4. main()
  5. {
  6.  int i;
  7.  int j;
  8.  
  9.  /* pmpstartsig(1000): set the timer for every 1 millisecond. */
  10.  /* P: produce profiling information. */
  11.  /* pmp("test.out"): save pmp's results in test.out. */
  12.  
  13.  pmpstartsig(1000);
  14.  
  15.  for (i = 0;i < 1000;i++)
  16.   {
  17.    P;
  18.    for (j = 0;j < 1000;j++)
  19.     {
  20.      P;
  21.      if (i % 2)
  22.        P;
  23.     }
  24.   }
  25.  pmp("test.out");
  26. }
  27. csh> cc -o test test.c pmplib.o
  28. csh> ./test
  29. csh> pmp test.c test.out
  30. #include "pmplib.h"
  31.  
  32. main()
  33. {
  34.  int i;
  35.  int j;
  36.  
  37.  /* pmpstartsig(1000): set the timer for every 1 millisecond. */
  38.  /* P: produce profiling information. */
  39.  /* pmp("test.out"): save pmp's results in test.out. */
  40.  
  41.  pmpstartsig(1000);
  42.  
  43.  for (i = 0;i < 1000;i++)
  44.   {
  45.    P; /* 1000+0 */
  46.    for (j = 0;j < 1000;j++)
  47.     {
  48.      P; /* 1000000+243 */
  49.      if (i % 2)
  50.        P; /* 500000+105 */
  51.     }
  52.   }
  53.  pmp("test.out");
  54. }
  55. csh> 
  56.