Skip to content

Instantly share code, notes, and snippets.

@mishamyrt
Created June 15, 2019 14:23
Show Gist options
  • Save mishamyrt/a3a1aa1da25ad894b14b35bfc777c281 to your computer and use it in GitHub Desktop.
Save mishamyrt/a3a1aa1da25ad894b14b35bfc777c281 to your computer and use it in GitHub Desktop.
const tolerance = 14
const tasks = 8
const cores = 8
const hz_min = 1
const hz_max = 2000
const inc = 20
const cycles = tasks / cores
for (let hz = hz_min; hz < hz_max + 1; hz += inc) {
const ms = cycles * 1000 / hz
if (ms > tolerance)
continue
console.log(`${hz}hz → ${ms}ms`)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment