File size: 647 Bytes
00df61d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * @license
 * Copyright 2014 The Emscripten Authors
 * SPDX-License-Identifier: MIT
 */

var MAGIC = 0;
Math.random = () => {
  MAGIC = Math.pow(MAGIC + 1.8912, 3) % 1;
  return MAGIC;
};

var TIME = 10000;
function deterministicNow() {
  return TIME++;
}

Date.now = deterministicNow;

// Note: this approach does not work on certain versions of Node.js
// Specifically it seems like its not possible to override performance.now on
// node v16 through v18.
if (globalThis.performance) performance.now = deterministicNow;

// for consistency between different builds than between runs of the same build
Module['thisProgram'] = 'thisProgram';