Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. const tolerance = 14
  2. const tasks = 8
  3. const cores = 8
  4. const hz_min = 1
  5. const hz_max = 2000
  6. const inc = 20
  7.  
  8. const cycles = tasks / cores
  9.  
  10.  
  11. for (let hz = hz_min; hz < hz_max + 1; hz += inc) {
  12. const ms = cycles * 1000 / hz
  13. if (ms > tolerance)
  14. continue
  15.  
  16. console.log(`${hz}hz → ${ms}ms`)
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement