Welcome, guest | Sign In | My Account | Store | Cart

Python version sleep sort by using threading.Timer

Python, 7 lines
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()