Sleep for 1000 years

C (gcc), 40 36 32 29 26 24 bytes

i;f(){--i&&f(sleep(7));}

Try it online!

-3 thanks to @gastropner.

-1 recursive approach thanks to @AZTECCO.

4294967295*7/86400/365.25 ~ 952.69


Python 3 (Excluding CPython on Windows), 28 bytes

import time
time.sleep(3e10)

Try it online! (Remember to put something in your will so future generations can check that it ended on time.)

time.sleep(seconds) takes either an int or a float.

1000*365.2422*24*60*60/3e10 == 1.051897536 which is an error of less than 10%.


bash, 26 24 bytes

I think part of the challenge here is to not have a signed 32 bit overflow, so:

ping -i86400 -c365243 t.co

The idea here is to make 1000 years of pings (365243), once per day (86400).

"t.co" is simply a four character internet hostname (in this case, a link shortener). If your local host table has a one character hostname, you can subtract 3 bytes.

Edit: corvus-192 points out that country code ai resolves as a host, so you can write:

ping -i86400 -c365243 ai

As this will should work for anyone, I will accept this. Saved 2 bytes.

Tags:

Date

Code Golf