NH> do {
NH> end = time(NULL);
NH> } while (difftime(end, start) < 60.0);
JC> I'd _strongly_ advise doing this considerably differently. I'd
JC> use something more like:
JC>
JC> void CALLBACK TimerProc(HWND wnd, UINT, UINT timer, DWORD) {
JC> KillTimer(wnd, timer); // The timer will continue to fire
JC> // every minute unless we kill it.
I currently use my method in a much larger loop inside a comm. program
while I'm waiting for modems to hash. There is quite a bit of
processing going in the loop besides just time polling. Nevertheless,
it seems to me that a Windows timer would probably be preferable as it
would most likely free more other processes.
One question though. How does the timer itself get the time?
* KWQ/2 1.2i *
--- TMail v1.31.5
---------------
* Origin: Diablo Valley PCUG-BBS, Walnut Creek, CA 510/943-6238 (1:161/55)
|