09-16-04 10:45 PM
-----BEGIN PGP SIGNED MESSAGE-----
Thomas J. Boschloo wrote:
| The time(0) only changes each second, and clock() doesn't seem to return
| anything under Windows XP :-((( Changing clock() to float also doesn't
| help (but I checked the include directory of Borland C++ which had it
| written down as a long).
Well, clock() does seem to work under XP, it just returns the number of
milliseconds an app has run! Only, it seems to have a resolution of
16/1000 seconds only :-( Close to 1/100 though! Only slightly worse.
Still, it is probably time to indeed kiss that code goodbye and get
something more secure..
Regards,
Thomas
#include <stdio.h>
#include <time.h>
void main(void)
{
clock_t t1, t2;
for(;;)
{
t1=clock();
do t2=clock(); while(t1==t2);
printf("t1=%li, t2=%li\n", t1, t2);
}
}
- --
Mean Guns, The Three Bears, Deedee: "So she is Goldilocks",
Lou: "Yeah, and you're a stupid",
Deedee: "I have just about had it with you Lou"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iQB5AwUBQUOLTAEP2l8iXKAJAQHtCwMeI3cEpu8E
DmHnWWh+TuaXPlWaCyBCI9S2
otUnTUI2eOW7gxqePkv8YfJzM7OmfSXxReOQUQkY
+TmBJVRCc5yz5KbhUhsvoflm
kTHYZLdxBBIeEfvL0DyhxgLnGSfbMwXmlN305w==
=Zmq0
-----END PGP SIGNATURE-----
[ Post a follow-up to this message ]
|