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  *  October 22, 1997 - code cleanup to remove ANSI C compiler warnings
18  *                     Andy Kahn <kahn@zk3.dec.com>
19  *
20  ******************************************************************************/
21 
22 /* this module is #included in other modules--no separate SCCS ID */
23 
24 /*
25  *  Timing routine
26  *
27  */
28 
29 #include <signal.h>
30 #include <unistd.h>
31 
wake_me(seconds,func)32 void wake_me(seconds, func)
33 	int seconds;
34 	void (*func)();
35 {
36 	/* set up the signal handler */
37 	signal(SIGALRM, func);
38 	/* get the clock running */
39 	alarm(seconds);
40 }
41 
42