Defines | |
#define | MyMAXLONG ((long)~(1L << ((8 * (int)sizeof(long)) - 1))) |
Typedefs | |
typedef timeval TimerStruct * | Timer |
typedef clock_t | TimerFast |
Functions | |
void | expire (int n) |
unsigned long | timerElapsed (Timer timer) |
unsigned long | timerElapsedFast (TimerFast timer) |
void | timerFree (Timer timer) |
void | timerInitialize (void) |
Timer | timerNew (void) |
void | timerSetAlarm (long unsigned int limit) |
void | timerStart (Timer timer) |
TimerFast | timerStartFast (void) |
void | timerStopAlarm (void) |
Variables | |
double | timerClockTicks = -1 |
Boolean | timerExpired |
Boolean | timerExpired |
|
a local macro to define the maximal long value Definition at line 28 of file timer.h. |
|
the slow timer Definition at line 32 of file timer.h. Referenced by cmdChunk(), cmdIncrementalCompletion(), cmdISearch(), cmdNewnet(), cnBuildEdges(), cnBuildNodes(), timerElapsed(), timerFree(), timerNew(), and timerStart(). |
|
the fast timer Definition at line 31 of file timer.h. Referenced by timerElapsedFast(), and timerStartFast(). |
|
Signal handler for when timer expires. this function sets timerexpired. Definition at line 156 of file timer.c. References timerExpired, and TRUE. Referenced by timerSetAlarm(). |
|
Return milliseconds elapsed since last timerStart() on this timer. this function returns the difference between the time used so far and a time determined earlier by timerstart() in milliseconds. Definition at line 130 of file timer.c. References CDG_ERROR, cdgPrintf(), and Timer. Referenced by cmdChunk(), cmdIncrementalCompletion(), cmdISearch(), cmdNewnet(), cnBuildEdges(), cnBuildNodes(), comApprove(), comCompareAllLvPairs(), and comCompareWithContext(). |
|
return milliseconds elapsed since last timerStartFast this function returns the difference between the time used so far and a time determined earlier by timerstartfast() in milliseconds. Definition at line 72 of file timer.c. References timerClockTicks, and TimerFast. |
|
frees the timer memory this function deallocates a timer. Definition at line 116 of file timer.c. Referenced by cmdChunk(), cmdIncrementalCompletion(), cmdISearch(), cmdNewnet(), cnBuildEdges(), cnBuildNodes(), and comFreeApprover(). |
|
timerInitialize this function stops any alarms pending and initializes the variable timerclockticks. Definition at line 244 of file timer.c. References timerClockTicks, and timerStopAlarm(). Referenced by cdgInitialize(). |
|
allocates memory for the timer and calls timerStart Definition at line 103 of file timer.c. References Timer, and timerStart(). Referenced by cmdChunk(), cmdIncrementalCompletion(), cmdISearch(), cmdNewnet(), cnBuildEdges(), cnBuildNodes(), and comNewApprover(). |
|
Set an alarm-clock that will set the flag timerExpired after ``limit'' milliseconds. this function sets a time limit for the completion of a task. after limit milliseconds the variable timerexpired is asynchronously set to~1 by expire(). this can be used as follows: \/\* build lvs for one second \*\/ void fastbuildvalues( constraintnet net, leveldecl level, ConstraintNode cn, List modifiers) { LexemNode modifiee; * LevelValue lv; int i; List l; String label; timerSetAlarm(1000); for (i = 0; i < vectorSize(net->lexemgraph->nodes); i++) { modifiee = (LexemNode) vectorElement(net->lexemgraph->nodes, i) for (l = level->labels; l != NULL; l = l->next) { label = (String) l->item; lv = lvNew(modifiers, level, label, modifiee); vectorAddElement(node->values, lv); } if(timerExpired) { break; } } } Definition at line 204 of file timer.c. References expire(), FALSE, NULL, and timerExpired. Referenced by cmdFrobbing(), and cmdShift(). |
|
Store number of cycles elapsed since program start (user + system) in timer. This function performs a call to getrusage() and fills the corresponding fields in the Timer structure. Definition at line 88 of file timer.c. Referenced by comApprove(), comCompareAllLvPairs(), comCompareWithContext(), and timerNew(). |
|
return clocks elapse since program start (user + system) this function returns the time used so far by the process, as computed by the system function clock()=. Definition at line 61 of file timer.c. References TimerFast. |
|
stop the alarm clock This function cancels the alarm set by timerSetAlarm(). Definition at line 229 of file timer.c. References FALSE, and timerExpired. Referenced by cmdFrobbing(), cmdShift(), and timerInitialize(). |
|
initialized correctly in timerInitialize Definition at line 48 of file timer.c. Referenced by timerElapsedFast(), and timerInitialize(). |
|
This variable timerExpired= is a flag to be set after a user-defined timespan has elapsed. Definition at line 46 of file timer.c. Referenced by expire(), timerSetAlarm(), and timerStopAlarm(). |
|
This variable timerExpired= is a flag to be set after a user-defined timespan has elapsed. Definition at line 46 of file timer.c. Referenced by expire(), timerSetAlarm(), and timerStopAlarm(). |