In [4]:
import time, threading
on=True
times=[]

In [6]:
def foo():
    print(time.ctime())
    times.append(time.ctime())
    threading.Timer(10, foo).start()

foo()


Sat May 13 14:08:49 2017

In [7]:
print(times)


['Sat May 13 14:08:49 2017']
Sat May 13 14:08:59 2017
Sat May 13 14:09:09 2017
Sat May 13 14:09:19 2017

In [26]:
print(times[0]<times[1])

In [3]:


In [4]:


In [ ]:


In [ ]: