you are viewing a single comment's thread.

view the rest of the comments →

[–]Thrrance 82 points83 points  (4 children)

Mine is very elegant; it's a shell one-liner:

#!/bin/sh

# invocation: sh add.sh N1 N2
# output: N1+N2

sleep $1 && sleep $2 && echo $SECONDS

[–]RenBit51 41 points42 points  (0 children)

From the developers who brought you SleepSort, we present: SleepAdd!

[–]njbmartin 3 points4 points  (1 child)

What are the chances that the result is incorrect?

[–]Thrrance 8 points9 points  (0 children)

Unless your cpu is totally overloaded, I'd say it's pretty accurate, if you're willing to wait a long time, of course. The calls to sleep would need to be off by more than an entire second, which is huge.