import time before using it

And we should import time before using it too. Silly mistakes!