2005-10-02

The Python of Tomorrow

The Python implementation:

#!/usr/bin/env python
import time
import os
t = time.localtime(86400 + time.time())
os._exit(t[2])

If you ignore the imports — and I do — then this is, in fact, two lines long. There's a good reason why I didn't write this in Python first:

$ time ./tomorrow.py
    0m0.77s real     0m0.16s user     0m0.19s system
$ time /usr/local/bin/tomorrow
    0m0.04s real     0m0.00s user     0m0.00s system

No comments: