home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / byte-benchmarks3.1 / part01 / src / timeit.c < prev   
Encoding:
C/C++ Source or Header  |  1992-02-01  |  1.1 KB  |  39 lines

  1. /*******************************************************************************
  2.  *          
  3.  *  The BYTE UNIX Benchmarks - Release 3
  4.  *          Module: timeit.c   SID: 3.3 5/15/91 19:30:21
  5.  *******************************************************************************
  6.  * Bug reports, patches, comments, suggestions should be sent to:
  7.  *
  8.  *    Ben Smith, Rick Grehan or Tom Yager
  9.  *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  10.  *
  11.  *******************************************************************************
  12.  *  Modification Log:
  13.  *  May 12, 1989 - modified empty loops to avoid nullifying by optimizing
  14.  *                 compilers
  15.  *  August 28, 1990 - changed timing relationship--now returns total number
  16.  *                      of iterations (ty)
  17.  *
  18.  ******************************************************************************/
  19.  
  20. /* this module is #included in other modules--no separate SCCS ID */
  21.  
  22. /*
  23.  *  Timing routine
  24.  *
  25.  */
  26.  
  27. #include <signal.h>
  28.  
  29. wake_me(seconds, func)
  30. int seconds;
  31. void (*func)();
  32. {
  33.     /* set up the signal handler */
  34.     signal(SIGALRM, func);
  35.     /* get the clock running */
  36.     alarm(seconds);
  37. }
  38.  
  39.