Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

bench-utils.ts

20 lines426 Bytes

1export const memoryBenchOptions = {
2 iterations: 1,
3 warmupIterations: 1,
4 time: 0,
5 warmupTime: 0,
6 throws: true,
7}
8​
9export function createDeterministicRandom(seed: number) {
10 let state = seed >>> 0
11​
12 return () => {
13 state = (state * 1664525 + 1013904223) >>> 0
14 return state / 0x100000000
15 }
17​
18export function randomSegment(random: () => number) {
19 return Math.floor(random() * 1_000_000_000).toString(36)