Mail Archives: djgpp/2000/02/12/13:42:33
In article <591baskf2ns6u0n0l6kp8rgml7aa2q80la AT 4ax DOT com>, REPLYTOd_yerrick AT hotmail DOT comNO2CANNEDHAM wrote:
>On Sat, 12 Feb 2000 14:55:24 +0200, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
>wrote:
>
>>Damian Yerrick wrote:
>>>
>>> Is it possible to get the uptime of a DOS system? I need more entropy
>>> than the 32 bits I get from time(NULL) to initialize a pseudorandom
>>> number generator.
>>
>>Did you try `uclock' or `gettiomeofday'? It's in the FAQ (section 22.23).
>
>uclock() won't work because it measures uptime of the current process,
>which is *known* when the process starts, which is when I seed my PRNG
>and start Allegro. And because Allegro reprograms the timer, I can't
>reseed from uclock() after the program starts.
>
>gettimeofday() won't work because it in theory can be calculated from
>time(NULL), which I'm already using, and adds no entropy.
>
I'm nosy: Why isn't all of this enough for you?
What about the user? How about a "Any key to continue" message and you measure
the time it takes to answer that one and then combine it with time (NULL).
--
Manni
- Raw text -