Advertisement
here2share

# dynamic_timer.py

Feb 19th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. # dynamic_timer.py ### ZZZ
  2.  
  3. import time
  4.  
  5. def t(): pass
  6. def m(): pass
  7. def delay(var,sec): ### moderate speed
  8.     code="""if 1:
  9.     try:
  10.         t.@@@=m.@@@-time.time()
  11.     except:
  12.         m.@@@=time.time()+sec
  13.     t.@@@=m.@@@-time.time()
  14.     if int(t.@@@) < 0.000000001: t.@@@=0""".replace('@@@',var)
  15.     exec code
  16.  
  17. while 1:
  18.     delay('five',5)
  19.     delay('ten',10)
  20.     print t.five,'\n\t\t',t.ten
  21.     print
  22.     if not t.ten:
  23.         break
  24. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement