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

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] rbn@sopuli.xyz 32 points 17 hours ago (2 children)

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 3 points 7 hours ago

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

[–] filcuk@lemmy.zip 35 points 16 hours ago (1 children)

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

[–] lugal@lemmy.dbzer0.com 5 points 11 hours ago

Better yet: take the square root and you get a sub-linear run time