+++ /dev/null
-/*\r
- * Copyright (c) 1993 George V. Neville-Neil\r
- * All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * 3. The name, George Neville-Neil may not be used to endorse or promote\r
- * products derived from this software without specific prior\r
- * written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- */\r
-\r
-#ifndef _TIMING_H_\r
-#define _TIMING_H_\r
-\r
-#ifdef TIME_WITH_SYS_TIME\r
-#include <sys/time.h>\r
-#include <time.h>\r
-#else /* !TIME_WITH_SYS_TIME */\r
-#ifdef HAVE_SYS_TIME_H\r
-#include <sys/time.h>\r
-#else /* !HAVE_SYS_TIME_H */\r
-#include <time.h>\r
-#endif /* !HAVE_SYS_TIME_H */\r
-#endif /* !TIME_WITH_SYS_TIME */\r
-\r
-static struct timeval aftertp, beforetp;\r
-\r
-#define BEGINTIMING gettimeofday(&beforetp, NULL)\r
-\r
-#define ENDTIMING gettimeofday(&aftertp, NULL); \\r
- if(beforetp.tv_usec > aftertp.tv_usec) \\r
- { \\r
- aftertp.tv_usec += 1000000; \\r
- aftertp.tv_sec--; \\r
- }\r
-\r
-#define TIMINGUS (((aftertp.tv_sec - beforetp.tv_sec) * 1000000) + \\r
- (aftertp.tv_usec - beforetp.tv_usec))\r
-\r
-#define TIMINGMS (((aftertp.tv_sec - beforetp.tv_sec) * 1000) + \\r
- ((aftertp.tv_usec - beforetp.tv_usec) / 1000))\r
-\r
-#define TIMINGS ((aftertp.tv_sec - beforetp.tv_sec) + \\r
- (aftertp.tv_usec - beforetp.tv_usec) / 1000000)\r
-\r
-#endif /* _TIMING_H_ */\r