Changed to using time module over datetime for python 3.2 compat.