• rbn@sopuli.xyz
    link
    fedilink
    arrow-up
    31
    ·
    10 hours 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…

    • BlueKey@fedia.io
      link
      fedilink
      arrow-up
      2
      ·
      51 minutes ago

      Maybe not peak performance but heigh CPU efficency, it’s load ist mostly 0.

    • filcuk@lemmy.zip
      link
      fedilink
      arrow-up
      32
      ·
      10 hours 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!