Data Structures | Files | Defines

EGtimer

Data Structures

struct  EGtimer_t
 Get system time. More...

Files

file  eg_timer.h

Defines

#define EGtimerReset(__timer)   ({(__timer)->time = 0;})
 this function reset the accumulated time to zero
#define EGtimerStart(__timer)   ({(__timer)->stime = __EGzeit();})
 Set a new starting time for the __timer.
#define EGtimerStop(__timer)   ({(__timer)->time += __EGzeit() - (__timer)->stime;})
 Stop a 'running' __timer and accumulate the run time.
#define EGwallClockTimer_t   EGtimer_t
 This is done for backward compability, we used to define EGwallClockTimer_t just as the normal __timer, so in reality we don't need another type, but keep the name so that older code depending on this still compiles.
#define EGwallClockTimerReset(__timer)   EGtimerReset(__timer)
 Reset the accumulated time to zero.
#define EGwallClockTimerStart(__timer)   ({(__timer)->stime = time(0);})
 Set the starting time the current (wall) time.
#define EGwallClockTimerStop(__timer)
 Stop a 'running' __timer and accumulate the (wall) runing time.

Detailed Description

Here we implement types and functions for __timer functions

Version:
1.0.1
History:
  • 2006-01-25
    • Fix compilation errors on sun, change includes accordingly and code
  • 2005-05-31
  • 2004-01-20
    • Add a 'wall clock' __timer (Renan-Marcos) type and functions
  • 2003-05-08
    • First Implementation
Note:
Up to now, this code will only work on linux machines, and maybe on unix/posix systems.

Define Documentation

#define EGtimerReset (   __timer  )     ({(__timer)->time = 0;})

this function reset the accumulated time to zero

Examples:
eg_dijkstra.ex.c, eg_ehash.ex.c, eg_maxclosure.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, eg_raset.ex.c, and eg_slk.ex.c.

Definition at line 114 of file eg_timer.h.

Referenced by main().

#define EGtimerStart (   __timer  )     ({(__timer)->stime = __EGzeit();})

Set a new starting time for the __timer.

Parameters:
__timer pointer to a EGtimer_t structure.
Returns:
starting time (in seconds), and the type is a double.
Examples:
eg_dijkstra.ex.c, eg_ehash.ex.c, eg_maxclosure.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, eg_raset.ex.c, and eg_slk.ex.c.

Definition at line 105 of file eg_timer.h.

Referenced by main().

#define EGtimerStop (   __timer  )     ({(__timer)->time += __EGzeit() - (__timer)->stime;})

Stop a 'running' __timer and accumulate the run time.

Returns:
the time elapsed since the last 'start' call (in seconds).
Examples:
eg_dijkstra.ex.c, eg_ehash.ex.c, eg_maxclosure.ex.c, eg_min_cut.ex.c, eg_push_relabel.ex.c, eg_raset.ex.c, and eg_slk.ex.c.

Definition at line 110 of file eg_timer.h.

Referenced by main().

#define EGwallClockTimer_t   EGtimer_t

This is done for backward compability, we used to define EGwallClockTimer_t just as the normal __timer, so in reality we don't need another type, but keep the name so that older code depending on this still compiles.

Definition at line 99 of file eg_timer.h.

#define EGwallClockTimerReset (   __timer  )     EGtimerReset(__timer)

Reset the accumulated time to zero.

Definition at line 129 of file eg_timer.h.

#define EGwallClockTimerStart (   __timer  )     ({(__timer)->stime = time(0);})

Set the starting time the current (wall) time.

Returns:
the current wall time.

Definition at line 119 of file eg_timer.h.

#define EGwallClockTimerStop (   __timer  ) 
Value:
({\
  (__timer)->time += difftime(time(0),(__timer)->stime);})

Stop a 'running' __timer and accumulate the (wall) runing time.

Returns:
the wall time elapsed since the last initialization.

Definition at line 124 of file eg_timer.h.