Datetime

Print current time

from datetime import datetime
datetime.now().strftime('%Y-%m-%d %H:%M:%S')
# '2015-12-29 14:02:27'

Get current time

import datetime
datetime.datetime.now()
# datetime(2009, 1, 6, 15, 8, 24, 78915)

Unixtime

import time
int(time.time())

Measure time elapsed

import time

start = time.time()
print("hello")
end = time.time()
print(end - start)