소스 검색

change timer

micha 2 년 전
부모
커밋
a5af848fb5
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      remote/fader_in.py

+ 5 - 1
remote/fader_in.py

@@ -39,6 +39,9 @@ mc.delete("another_key")
 import time
 import json
 data = {}
+start = time.time()
+delta = start
+
 while 1:
     send = 0
     try:
@@ -61,7 +64,8 @@ while 1:
         #data = input("<")
 
         v = x[ch]
-        cmd={"iDMX":ch,"iVAL":v,"iT":round(time.time(),2)} #".format(ch,v)
+        delta = time.time()-start
+        cmd={"iDMX":ch,"iVAL":v,"iT":round(delta,2)} #".format(ch,v)
         cmd = json.dumps([cmd])
         if ch in data:
             if data[ch] != v: