Re: Question for Windows/BeOS Developers.


Subject: Re: Question for Windows/BeOS Developers.
From: Pierre Abbat (phma@oltronics.net)
Date: Wed Aug 23 2000 - 20:50:18 CDT


>Which works great. time() returns the number seconds since 1970. Is there
>a similar function in windows? I just need a function that is guarenteed
>to give a different result on every call. Since time always increases this
>will always work :-)

In Windows, QueryPerformanceCounter() reads the time to one count of the timer
chip, which is about 0.8 microseconds (64K of these is one timer interrupt
period). You won't get two calls of this returning the same number unless
you're running a multiprocessor system, and even then it's unlikely.

In Unix, I'd read /dev/(u)random rather than using the time. Make sure you read
enough bytes to avoid birthday attacks.

phma



This archive was generated by hypermail 2b25 : Wed Aug 23 2000 - 20:58:00 CDT