Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

timer.h

00001 /* Copyright (C) 1997-2004 The CDG Team <cdg@nats.informatik.uni-hamburg.de> 00002 * 00003 * This file is free software; as a special exception the author gives 00004 * unlimited permission to copy and/or distribute it, with or without 00005 * modifications, as long as this notice is preserved. 00006 * 00007 * This program is distributed in the hope that it will be useful, but 00008 * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 00009 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00010 * 00011 * $Id: timer.h,v 1.19 2004/09/27 17:07:06 micha Exp $ 00012 */ 00013 00014 /* --------------------------------------------------------------------------- 00015 * @addtogroup Timer 00016 * @{ 00017 */ 00018 00019 #ifndef _TIMER_H 00020 #define _TIMER_H 00021 #include <config.h> 00022 #include <unistd.h> 00023 #include <time.h> 00024 #include <sys/resource.h> 00025 00026 00027 /** a local macro to define the maximal long value */ 00028 #define MyMAXLONG ((long)~(1L << ((8 * (int)sizeof(long)) - 1))) 00029 00030 /* -- TYPE DEFINITIONS -------------------------------------------------- */ 00031 typedef clock_t TimerFast; /**< the fast timer */ 00032 typedef struct timeval TimerStruct, *Timer; /**< the slow timer */ 00033 00034 /* -- FUNCTIONS --------------------------------------------------------- */ 00035 extern void timerInitialize(void); 00036 00037 extern TimerFast timerStartFast(); 00038 extern unsigned long timerElapsedFast(TimerFast); 00039 00040 extern void timerStart(Timer); 00041 extern Timer timerNew(); 00042 extern void timerFree(Timer); 00043 extern unsigned long timerElapsed(Timer); 00044 00045 extern void timerSetAlarm(long unsigned int limit); 00046 extern void timerStopAlarm(void); 00047 00048 /* -- VARIABLES --------------------------------------------------------- */ 00049 extern Boolean timerExpired; 00050 00051 00052 #endif 00053 /** @} */

CDG 0.95 (20 Oct 2004)