Quote:
Originally Posted by smeezekitty
how can you even call a program 1000000 times per second?
bash, batch and C system and exec calls are all too slow.
the only way you could do it is if its from withen it self and in that case it would have the same PID.
|
If you XOR the PID, you don't have to use that type of time resolution.
I can't tell you why, but I like
Code:
seed ( getpid() ^ time() );
better than
Code:
seed( tv_sec * tv_usec (microseconds));
Moore's law ought to knock about 3 orders of magnitude off your safety factor there in 10 years, or 6 in 20. The first line of code will work just as well then as now. The second? I'll take your bet that I can't launch processes that fast in 10 years.