import threading
import time
class Sleeper(object):
def __init__(self, sleep_func):
self.sleep = sleep_func
def __del__(self):
self.sleep(1)
def thread_func():
sleeper = Sleeper(time.sleep)
a = 1
while True:
a += 1
thread = threading.Thread(target=thread_func)
thread.setDaemon(True)
thread.start()
aW1wb3J0IHRocmVhZGluZwppbXBvcnQgdGltZQoKY2xhc3MgU2xlZXBlcihvYmplY3QpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIHNsZWVwX2Z1bmMpOgogICAgICAgIHNlbGYuc2xlZXAgPSBzbGVlcF9mdW5jCgogICAgZGVmIF9fZGVsX18oc2VsZik6CiAgICAgICAgc2VsZi5zbGVlcCgxKQoKZGVmIHRocmVhZF9mdW5jKCk6CiAgICBzbGVlcGVyID0gU2xlZXBlcih0aW1lLnNsZWVwKQogICAgYSA9IDEKICAgIHdoaWxlIFRydWU6CiAgICAgICAgYSArPSAxCgp0aHJlYWQgPSB0aHJlYWRpbmcuVGhyZWFkKHRhcmdldD10aHJlYWRfZnVuYykKdGhyZWFkLnNldERhZW1vbihUcnVlKQp0aHJlYWQuc3RhcnQoKQo=