this post was submitted on 04 Nov 2025
431 points (99.1% liked)
Programmer Humor
27193 readers
1023 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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...
Maybe not peak performance but heigh CPU efficency, it's load ist mostly 0.
As added benefit, you can then opyimise the code by dividing the number by 2, making it twice as fast. Think of the savings!
Better yet: take the square root and you get a sub-linear run time