Watt-32 tcp/ip  2.2 dev-rel.10
Functions | Variables
timer.h File Reference

Go to the source code of this file.


uint64 win_get_perf_count (void)
DWORD clockbits (void)
int hires_timer (int on)
 Control use of high-resolution timer. More...
DWORD ms_clock (void)
void init_timer_isr (void)
void exit_timer_isr (void)
void init_timers (void)
 Setup timer stuff and measure CPU speed. More...
DWORD millisec_clock (void)
const char * time_str (DWORD val)
const char * hms_str (DWORD sec)
const char * elapsed_str (DWORD val)
void delay (unsigned int msec)
uint64 get_cpu_speed (void)
 Return estimated CPU speed in Hz.


W32_DATA BOOL has_rdtsc
W32_DATA BOOL use_rdtsc
BOOL has_8254
 Do we have a working 8254 timer chip?
BOOL using_int8
 init_timer_isr() called
W32_DATA BOOL user_tick_active
W32_DATA DWORD clocks_per_usec
W32_DATA DWORD user_tick_msec
W32_DATA time_t user_tick_base
W32_DATA DWORD start_time
W32_DATA DWORD start_day

Function Documentation

int hires_timer ( int  on)

Control use of high-resolution timer.

When using Watt-32 together with programs that reprogram the PIT (8254 timer chip), the millisec_clock() function may return wrong values. In such cases it's best to use old-style 55ms timers. Using Watt-32 with Allegro graphics library is one such case where application program should call `hires_timer(0)' after `sock_init()' has been called.

Definition at line 377 of file timer.c.

void init_timers ( void  )

Setup timer stuff and measure CPU speed.

Called from init_misc().


check if 8254 PIT is really working

Definition at line 111 of file timer.c.

References chk_timeout(), clocks_per_usec, get_cpu_speed(), get_day_num(), has_rdtsc, hires_timer(), set_timeout(), set_utc_offset(), start_day, start_time, and use_rdtsc.