Hide Ads
 Refresh   About   Tools 

PHP mt_rand() Randomosity Tester

TIMEOUT
+339,908 data
+1 +10 +100 +1K +10K +MAX
range: 1-100, data points: 339,909, groups: 71
High / Low / Range / Average
Frequency: 3,599 / 3,231 / 368 / 3,399.09
Rows: 3 / 1 / 2 / 1.41
Frequency
Rows
3,599
1
3,511
1
3,494
1
3,488
2
3,487
1
3,475
1
3,473
1
3,471
2
3,463
1
3,462
2
3,461
1
3,457
1
3,452
1
3,449
2
3,448
1
3,445
1
3,442
1
3,439
1
3,437
1
3,436
1
3,435
2
3,432
2
3,431
2
3,428
1
3,427
1
3,424
1
3,423
2
3,422
3
3,419
1
3,418
1
3,416
1
3,413
1
3,411
3
3,410
1
3,407
1
3,402
2
3,401
1
3,398
1
3,395
1
3,392
1
3,391
2
3,390
2
3,389
2
3,385
1
3,383
3
3,381
2
3,379
1
3,377
1
3,376
1
3,375
1
3,372
1
3,371
2
3,370
1
3,368
2
3,367
1
3,365
3
3,358
1
3,356
1
3,352
2
3,341
1
3,340
1
3,334
3
3,330
1
3,326
1
3,323
1
3,315
1
3,312
3
3,310
2
3,308
1
3,242
1
3,231
1

Test runs: 339,909Avg run : 0.000004 seconds Test time: 1.418920 seconds Data Save: 0.186854 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 100.

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


Hide Ads