>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