home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 161_01 / document.d < prev    next >
Text File  |  1985-11-26  |  4KB  |  268 lines

  1. ###do.mp
  2. .ds F USER MANUAL
  3. .NM DO "repetitive timing macros"
  4. .SY
  5. #include "timer1.h"
  6.  
  7. DO_IEXPR(comment)    \f2\s10integer_expression\f6\s8    OD;
  8.  
  9. DO_FEXPR(comment)    \f2\s10floating_expression\f6\s8    OD;
  10.  
  11. DO_STMT(comment)    \f2\s10statement\f6\s8            OD;
  12.  
  13. DO_SKIP(comment)    \f2\s10statement\f6\s8                OD;
  14. char *comment;
  15. .FU
  16. The DO macro generates a loop around the code sample which
  17. executes it enough times to give 100 clock-tick samples for
  18. the code sample.
  19. The comment is printed on the timing report, along with the
  20. space requirement and CPU time for the code sample.
  21. The DO_SKIP macro simply place-holds a report output line.
  22. .MN
  23. ###do.mpo
  24.  
  25.  
  26.  
  27. DO                         USER MANUAL                          DO
  28.  
  29.  
  30.  
  31. NAME
  32.     DO - repetitive timing macro
  33.  
  34. SYNOPSIS
  35.     #include "timer1.h"
  36.  
  37.     DO_IEXPR(comment) integer_expression  OD;
  38.  
  39.     DO_FEXPR(comment) floating_expression OD;
  40.  
  41.     DO_STMT(comment)  statement           OD;
  42.     char *comment;
  43.  
  44.     DO_SKIP(comment)    statement          OD;
  45.  
  46. FUNCTION
  47.     The DO macro generates a loop around  the  code  sample  which
  48.     executes  it  enough  times to give 100 clock-tick samples for
  49.     the code sample.
  50.  
  51.     The comment is printed on the timing report,  along  with  the
  52.     space requirement and CPU time for the code sample.
  53.  
  54.     The DO_SKIP macro simply place-holds a report output line.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92. ###cputim.mp
  93. .ds F USER MANUAL
  94. .NM cputim "report CPU time since last call"
  95. .SY
  96. #include "cputim.h"
  97. cputim_t cputim()
  98. .FU
  99. .PT cputim
  100. tells how many clock ticks have elapsed since the
  101. previous invocation.
  102. The resolution of the CPU clock is system-dependent.
  103. On UNIX/Idris, it is 1/60 second.
  104. The header \f6"cputim.h"\f1 provides a defined constant named
  105. .PT CLOCK_TICKS_PER_SECOND .
  106. .MN
  107. ###cputim.mpo
  108.  
  109.  
  110.  
  111. cputim                     USER MANUAL                      cputim
  112.  
  113.  
  114.  
  115. NAME
  116.     cputim - report CPU time since last call
  117.  
  118. SYNOPSIS
  119.     long cputim()
  120.  
  121.     char *returnp(argp)
  122.     char *argp;
  123.  
  124. FUNCTION
  125.     Cputim tells how many clock ticks have elapsed since the  pre-
  126.     vious  invocations.   Its  format  is intended for portability
  127.     between operating systems.
  128.  
  129.     Returnp tells the address to which its calling  function  will
  130.     return.  It is passed the address of the first argument of the
  131.     calling function.  The location of the return pointer relative
  132.     to  the  first argument may be different on different systems;
  133.     therefore, the implementation of returnp may need tailoring to
  134.     each system.
  135.  
  136. BUGS
  137.     The resolution of  the  CPU  clock  is  system-dependent.   On
  138.     UNIX/Idris, it is 1/60 second.
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174. ###returnp.mp
  175. .ll 66
  176. .lt 66
  177. .ds F USER MANUAL
  178. .hy 15
  179. .NM returnp "reveal a function's return pointer"
  180. int *returnp(pa)
  181. int **pa;
  182. .FU
  183. .IT
  184. returnp
  185. tells the address to which its calling function will
  186. return.
  187. The argument passed to
  188. .IT
  189. returnp
  190. is system-dependent; it may be the address of the function's
  191. first argument, or the address of the function's first auto
  192. variable.
  193. The location of the return pointer 
  194. may be different on different systems;
  195. therefore, the implementation of returnp may need tailoring
  196. to each system.
  197. (Some simple customization is found in
  198. .IT
  199. "config.h".)
  200. ###returnp.mpo
  201.  
  202.  
  203.  
  204. returnp                    USER MANUAL                     returnp
  205.  
  206.  
  207.  
  208. NAME
  209.     returnp - reveal a function's return pointer
  210.  
  211. SYNOPSIS
  212.     int *returnp(pa)
  213.     int **pa;
  214.  
  215. FUNCTION
  216.     returnp_______ tells the address to which its calling  function  will
  217.     return.   The  argument passed to returnp_______ is system-dependent;
  218.     it may be the address of the function's first argument, or the
  219.     address  of  the function's first auto variable.  The location
  220.     of the return pointer may be different on  different  systems;
  221.     therefore, the implementation of returnp may need tailoring to
  222.     each  system.   (Some  simple  customization   is   found   in
  223.     "config______.h_".)
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. ###EOF
  268.