From: Timo Saarinen Newsgroups: comp.os.msdos.djgpp Subject: uclock in Windows Date: Wed, 05 Feb 1997 11:03:59 -0800 Organization: University of Kuopio / Library Lines: 26 Message-ID: <32F8D99F.3A03@uku.fi> Reply-To: Timo DOT Saarinen AT uku DOT fi NNTP-Posting-Host: kryssi8.uku.fi Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hi, I have tested the following program both in MS-DOS and Windows (3.11). In DOS it works well but in Windows 'dt' variable gets frequently negative values. Can some one tell me why this happens and is there any way to fix it? #include #include void main (void) { uclock_t t0 = uclock (), t; long dt; for (long i = 0; i < 100; i++) { t = uclock (); dt = t - t0; cout << " t0=" << (long) t0 << " t=" << (long) t << " dt=" << dt << endl; t0 = t; } } Timo DOT Saarinen AT uku DOT fi