www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/07/13:49:01

From: ville DOT sjoberg AT swipnet DOT se (Ville Sjoberg)
Newsgroups: comp.os.msdos.djgpp
Subject: rawclock returning incorrect (?) values
Date: Sat, 08 Mar 1997 02:24:10 GMT
Organization: -
Lines: 38
Message-ID: <5fpiuk$ebg@mn5.swip.net>
NNTP-Posting-Host: dialup154-6-2.swipnet.se
NNTP-Posting-User: s-222948
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm having trouble with the rawclock() function. According to the docs
it should return the number of tics since midnight. That should make a
pretty good function for srandom(), I thought. But the following code:

#include <time.h>
#include <stdio.h>

void main ()
{
	int n;

	for (n=0;n<10;n++)
		printf("%D\n", rawclock () );
};

printed something like
0
0
0
0
0
0
0
0
1
1
everytime I ran it. That's close to midnight!

Is this a bug in libc? in the docs? or haven't i got a clue?

----------------------------------------------
Vilhelm "Ville" Sjoeberg
Sci-fi geek, paranoid cyberpunk, celloplayer
PGP key available at www.villeweb.home.ml.org
"The future is not what it used to be."



- Raw text -


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