Better seeds than time(0)?

前端 未结 11 1909
挽巷
挽巷 2021-01-02 08:06

I understand that time(0) is commonly using for seeding random number generators and that it only becomes a problem when the program is being run more than once per second.

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-02 09:10

    You can store random seed on program exit and load it on start, so you'll need to initialize your RNG with time(0) only on first program start.

提交回复
热议问题