HTML Preparation code:
x
 
1
<script>
2
  'use strict';
3
const m = 4294967296;
4
const a = 1664525;
5
const c = 1013904223;
6
var z = 6700417;
7
8
const lcg = function() {
9
  'use strict';
10
    z = (a * z + c) % m;
11
    return z / m;
12
};
13
14
var rv = 0;
15
  
16
</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>

Previous results

Experimental features:

  • Test case name Result
    lcg
    math.random
    crypto

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36
Chrome 100 on Windows
View result in a separate tab
Test name Executions per second
lcg 2589035.0 Ops/sec
math.random 2440215.5 Ops/sec
crypto 420616.4 Ops/sec