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

bench-utils.ts

22 lines470 Bytes

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