Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
randoms
(version: 2)
Comparing performance of:
lcg vs math.random vs crypto
Created:
8 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script> 'use strict'; const m = 4294967296; const a = 1664525; const c = 1013904223; var z = 6700417; const lcg = function() { 'use strict'; z = (a * z + c) % m; return z / m; }; var rv = 0; </script>
Tests:
lcg
rv = lcg();
math.random
rv = Math.random();
crypto
{ let arr = new Uint32Array(1); crypto.getRandomValues(arr); rv = arr[0]; };
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
lcg
math.random
crypto
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
ceil vs code
ceil vs code bis
lodash vs fakerFork random
getRandomNumberInRange vs getRandomValueInRange 5000
Comments
Confirm delete:
Do you really want to delete benchmark?