Lines Matching defs:ticker
136 /* The following structure describes a ticker. */
137 struct ticker
139 /* The following member value is time of the ticker creation with
140 taking into account time when the ticker is off. Active time of
141 the ticker is current time minus the value. */
144 ticker was off. Zero value means that now the ticker is on. */
148 /* The ticker is represented by the following type. */
149 typedef struct ticker ticker_t;
3116 /* The page contains abstract data `ticker'. This data is used to
3121 /* The following function creates ticker and makes it active. */
3125 ticker_t ticker;
3127 ticker.modified_creation_time = get_run_time ();
3128 ticker.incremented_off_time = 0;
3129 return ticker;
3132 /* The following function switches off given ticker. */
3134 ticker_off (ticker_t *ticker)
3136 if (ticker->incremented_off_time == 0)
3137 ticker->incremented_off_time = get_run_time () + 1;
3140 /* The following function switches on given ticker. */
3142 ticker_on (ticker_t *ticker)
3144 if (ticker->incremented_off_time != 0)
3146 ticker->modified_creation_time
3147 += get_run_time () - ticker->incremented_off_time + 1;
3148 ticker->incremented_off_time = 0;
3153 the moment when given ticker was created. */
3155 active_time (ticker_t ticker)
3157 if (ticker.incremented_off_time != 0)
3158 return tickerticker.modified_creation_time;
3160 return get_run_time () - ticker.modified_creation_time;
3164 of given ticker. The result is string representation of seconds
3180 print_active_time (FILE *f, ticker_t ticker)
3184 msecs = active_time (ticker);