IMHO:
No need to do your own random generator code. If you want a new seed with each instance of your JSFX, I suppose you don't need to do anything, as (hopefully, please check) rand() is common to all instances. If you want a new seed with each start of you program you can simply use the current time in miliseconds as a seed generation e.g. in the way you suggested
BTW.:
"loop (randomSeed, rand(); );" might be slightly faster.
As time_precise granularity is not specified "*1000" does not necessarily provide miliseconds, though.
Limiting to 999 loops - and hence providing only 999 different program starts - is not necessary in @init. You can happily do a lot more loops.)
-Michael
Last edited by mschnell; 01-15-2017 at 12:18 AM.
|