Browse Source

small fixes

Simon Van Mierlo 9 years ago
parent
commit
08e15725e5

+ 2 - 2
src/python_sccd/python_sccd_runtime/accurate_time.py

@@ -6,8 +6,8 @@ def set_start_time():
     global start_time
     if os.name == 'posix':
         start_time = t.time()
-    else:
-         start_time = t.clock()
+    elif os.name == 'nt':
+        start_time = t.clock()
 
 if os.name == 'posix':
     def time():

+ 1 - 1
src/python_sccd/python_sccd_runtime/statecharts_core.py

@@ -492,7 +492,7 @@ class EventLoopControllerBase(ControllerBase):
             if earliest_event_time == INFINITY:
                 if self.finished_callback: self.finished_callback() # TODO: This is not necessarily correct (keep_running necessary?)
                 return
-            accurate_time.time()
+            now = accurate_time.time()
             if now - start_time > 10 or earliest_event_time - now > 0:
                 self.event_loop.schedule(self.run, earliest_event_time - now, now - start_time > 10)
                 if now - earliest_event_time > 10 and now - self.last_print_time >= 1000: