Python version sleep sort by using threading.Timer
1 2 3 4 5 6 7 | from __future__ import print_function
from threading import Timer
l = [8, 2, 4, 6, 7, 1]
for n in l:
Timer(n, lambda x: print(x), [n]).start()
|
Python version sleep sort by using threading.Timer
1 2 3 4 5 6 7 | from __future__ import print_function
from threading import Timer
l = [8, 2, 4, 6, 7, 1]
for n in l:
Timer(n, lambda x: print(x), [n]).start()
|