TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: NEIL HELLER
date: 1997-05-10 18:21:00
subject: timer() and difftime()

I was mucking around and came across the following.  Given the
following function:
void CTimerDlg::OnStart()
{
    time_t  start, end;
    start = time(NULL);
    do {
        end = time(NULL);
    } while (difftime(end, start) < 60.0);
    AfxMessageBox("Time's up");
}
This function would work as expected (that is, the message box would
pop-up 60 seconds after the "start" was pushed) when compiled as a
32-bit app. in MSVC 5.0.  However, when compiled as a 16-bit app. in
MSVC 1.5, this loop would time out in 30 - 40 seconds.  The tests were
run on a 90 mHz Pentium.  Does anybody have an idea?
 * KWQ/2 1.2i * 
--- TMail v1.31.5
---------------
* Origin: Diablo Valley PCUG-BBS, Walnut Creek, CA 510/943-6238 (1:161/55)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.