When C-sharp yield return and Random are used together, why do you get a variable that changes over time?

as shown in the figure, a function to get random numbers is written, and yield return

is used to save trouble.

:

:

if you write the code as

tbData.Text = String.Join("",data) + "\n\n" + String.Join("",data);
The data obtained from

is the same again, and the guess is related to time after several tests, because the seeds of random numbers vary according to time.
but why is this happening? Variables automatically change over time.

Mar.06,2021

because you use DateTime.Now.Millisecond as a random seed, this is millisecond. If two calls are less than 1 millisecond, the random seed you use twice is the same, and the result is the same. If the two calls are more than 1 millisecond, the seed is different and the random sequence is different.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38562-2ae4c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38562-2ae4c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?