Show Ads
 Refresh   About   Tools 

PHP mt_rand() Randomosity Tester

TIMEOUT
+1,046,783 data
+1 +10 +100 +1K +10K +MAX
range: 1-5,000, data points: 1,046,784, groups: 97
High / Low / Range / Average
Frequency: 259 / 0 / 259 / 20.94
Rows: 45,000 / 1 / 44,999 / 515.46
Frequency
Rows
259
2
258
1
255
3
254
5
253
2
252
1
251
2
250
3
249
2
248
3
247
5
246
4
245
10
244
5
243
11
242
8
241
19
240
14
239
12
238
27
237
17
236
18
235
30
234
26
233
33
232
46
231
64
230
43
229
59
228
56
227
48
226
79
225
81
224
79
223
84
222
87
221
105
220
97
219
126
218
108
217
115
216
119
215
143
214
129
213
124
212
132
211
115
210
160
209
116
208
133
207
127
206
144
205
151
204
127
203
139
202
121
201
126
200
108
199
112
198
104
197
97
196
85
195
86
194
85
193
78
192
59
191
63
190
65
189
71
188
49
187
35
186
34
185
36
184
34
183
24
182
23
181
19
180
12
179
12
178
10
177
5
176
4
175
5
174
6
173
6
172
7
171
4
170
3
169
2
168
3
167
1
166
1
164
1
163
2
162
2
157
1
0
45,000

Test runs: 1,046,784Avg run : 0.000001 seconds Test time: 1.421807 seconds Data Save: 0.489695 seconds Test Tools: Restart test: Random range 1 to: 1 2 3 4 5 10 50 100 500 1K 5K 10K 50K 100K Random Generator Method: SQLite ORDER BY RANDOM() PHP rand() PHP mt_rand() PHP random_int() Back to top


About the Randomosity Tester

This page tests the frequency distribution and timing of random number generation via these methods:

Random number results are stored in a test table. The test table is defined as:

CREATE TABLE 'test' ( 'id' INTEGER PRIMARY KEY, 'frequency' INTEGER DEFAULT '0' );

The table is initialized by creating all rows with frequency = 0. The number of rows in the table is defined by the range setting. The current test is set to use range: 1 to 5,000.

For each random number chosen, the table is updated via:

UPDATE test SET frequency = frequency + 1 WHERE id = :random_number

For SQLite tests, results are individually generated via the SQL call:

SELECT id FROM test ORDER BY RANDOM() LIMIT 1;

Generate more random numbers by clicking a  +  number button to start a test run.

Each test run is limted to ~1.42 seconds.

A Frequency of Frequencies chart displays:

This site was created with Open Source software. Find out more on Github: randomosity-tester v0.2.2

Back to top

Show Ads