FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
February 01, 1997
A Polled Timer Class

(Page 1 of 4)

February 1997/A Polled Timer Class/Listing 1

Listing 1: The Timer class

#ifndef timer_h
# define timer_h

#ifndef boolean #define boolean int #define true (1) #define false (0) #endif

const int max_timers = 10;

typedef int TIMER_HANDLE;

class TIMER { public: int executive_tic(void); TIMER_HANDLE open_timer(float seconds); boolean expired(const TIMER_HANDLE &handle); float time_left(const TIMER_HANDLE &handle); void close_timer(TIMER_HANDLE &handle); TIMER(void); ~TIMER(void){} private: const int count_mod; boolean timer_used[max_timers]; boolean timer_expired[max_timers]; int expire_time[max_timers]; int time_count; long last_bios_time; TIMER_HANDLE search_next_handle_start; };

#endif /* End of File */

1 | 2 | 3 | 4 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK