this post was submitted on 04 Nov 2025
472 points (99.2% liked)

Programmer Humor

27248 readers
1203 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 33 points 5 days 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...

[–] filcuk@lemmy.zip 35 points 5 days 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 5 days ago

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

[–] BlueKey@fedia.io 3 points 5 days ago

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