Created
June 15, 2019 14:23
-
-
Save mishamyrt/a3a1aa1da25ad894b14b35bfc777c281 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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