Skip to content

Instantly share code, notes, and snippets.

@michael-newton-15below
Created January 22, 2013 15:52
Show Gist options
  • Save michael-newton-15below/4595744 to your computer and use it in GitHub Desktop.
Save michael-newton-15below/4595744 to your computer and use it in GitHub Desktop.
Adaptive polling interval
let interval i =
let x = float i
let maxWait = 60. * 10.
let raisePower x = pown (x /10.) 4
(maxWait * (raisePower x)) / (raisePower x + 1.)
|> (*) 1000. |> int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment