Code: Select all
////////// Header…
class c_interval // interval timer based on TimeTick
{
public:
volatile DWORD start_time, timeout, interval;
explicit c_interval( DWORD msec = 1000 ); // interval in msec.
void Reset(DWORD msec=0);
bool Cycle(DWORD msec=0);
bool Expired();
DWORD ElapsedSec();
DWORD ElapsedMsec();
DWORD RemainingSec();
void ForceExpiration();
};
struct s_amp_info
{
int connected;
c_interval cooldown;
…
////////// Init()…
s_amp_info *pamp = amp_info+amp;
pamp->cooldown = 0; // What does this do?!
pamp->cooldown.Reset(60000); // Works.