• rbn@sopuli.xyz
    link
    fedilink
    arrow-up
    33
    ·
    2 days ago

    To reduce the chance of errors, you can multiply all numbers by a factor of 10, 100, 1000, 10000, … for the timeout. The higher the factor, the lower the chances of an incorrect result. And as no one asked about performance…

    • filcuk@lemmy.zip
      link
      fedilink
      arrow-up
      35
      ·
      2 days ago

      As added benefit, you can then opyimise the code by dividing the number by 2, making it twice as fast. Think of the savings!