www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/10/22/11:23:44

Date: 22 Oct 1993 11:09:00 -0400 (EDT)
From: pek AT logos DOT res DOT utc DOT com (Paul Kirschner)
Subject: clock() blows up under windows 3.1
To: djgpp AT sun DOT soe DOT clarkson DOT EDU

Consider, if you will, the following code:

#include <time.h>
float c_clock__()
{ return (float) clock()/CLOCKS_PER_SEC; }

Under DOS (6.0 if that matters) ( and DJGPP 1.10 by the way) it properly
returns the time.  (BTW - I use this function to track CPU time for code
execution.)

In a Windows 3.1 DOS window, it blows the window away! (or halts execution
depending if "Close on Exit" is set in the .pif.)  AND it seems to lock
out several megs of XMS!

Can this be fixed?  Is my error illusionary?  Is there a way around it?

------------------------------------------------------------------------------
Paul Kirschner                                       #include <disclaimer.std>
pek AT logos DOT res DOT utc DOT com
United Technologies Research Center

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019