@@ -988,8 +988,8 @@ def _handle_set_bio_gripper_init(self, block, prefix='', arg_map=None):
988988 self ._append_to_file ('{} if code != 0:' .format (prefix ))
989989 self ._append_to_file ('{} params[\' quit\' ] = True' .format (prefix ))
990990 self ._append_to_file ('{} pprint(\' set_bio_gripper_enable, code={{}}\' .format(code))' .format (prefix ))
991- # self._append_to_file('{}expired = time.time () + 2'.format(prefix))
992- # self._append_to_file('{}while not params[\'quit\'] and time.time () < expired:'.format(prefix))
991+ # self._append_to_file('{}expired = time.monotonic () + 2'.format(prefix))
992+ # self._append_to_file('{}while not params[\'quit\'] and time.monotonic () < expired:'.format(prefix))
993993 # self._append_to_file('{} time.sleep(0.1)'.format(prefix))
994994
995995 def _handle_set_bio_gripper (self , block , prefix = '' , arg_map = None ):
@@ -1427,10 +1427,10 @@ def _handle_controls_repeat_ext(self, block, prefix='', arg_map=None):
14271427 statement = self .get_node ('statement' , root = block )
14281428 if statement :
14291429 if self ._highlight_callback :
1430- self ._append_to_file ('{}t1 = time.time ()' .format (prefix ))
1430+ self ._append_to_file ('{}t1 = time.monotonic ()' .format (prefix ))
14311431 self .parse (statement , prefix , arg_map = arg_map )
14321432 if self ._highlight_callback :
1433- self ._append_to_file ('{}interval = time.time () - t1' .format (prefix ))
1433+ self ._append_to_file ('{}interval = time.monotonic () - t1' .format (prefix ))
14341434 self ._append_to_file ('{}if interval < 0.001:' .format (prefix ))
14351435 self ._append_to_file ('{} time.sleep(0.001 - interval)' .format (prefix ))
14361436 else :
@@ -1453,10 +1453,10 @@ def _handle_controls_whileUntil(self, block, prefix='', arg_map=None):
14531453 statement = self .get_node ('statement' , root = block )
14541454 if statement :
14551455 if self ._highlight_callback :
1456- self ._append_to_file ('{}t1 = time.time ()' .format (prefix ))
1456+ self ._append_to_file ('{}t1 = time.monotonic ()' .format (prefix ))
14571457 self .parse (statement , prefix , arg_map = arg_map )
14581458 if self ._highlight_callback :
1459- self ._append_to_file ('{}interval = time.time () - t1' .format (prefix ))
1459+ self ._append_to_file ('{}interval = time.monotonic () - t1' .format (prefix ))
14601460 self ._append_to_file ('{}if interval < 0.001:' .format (prefix ))
14611461 self ._append_to_file ('{} time.sleep(0.001 - interval)' .format (prefix ))
14621462 else :
@@ -1470,10 +1470,10 @@ def _handle_loop_run_forever(self, block, prefix='', arg_map=None):
14701470 statement = self .get_node ('statement' , root = block )
14711471 if statement :
14721472 if self ._highlight_callback :
1473- self ._append_to_file ('{}t1 = time.time ()' .format (prefix ))
1473+ self ._append_to_file ('{}t1 = time.monotonic ()' .format (prefix ))
14741474 self .parse (statement , prefix , arg_map = arg_map )
14751475 if self ._highlight_callback :
1476- self ._append_to_file ('{}interval = time.time () - t1' .format (prefix ))
1476+ self ._append_to_file ('{}interval = time.monotonic () - t1' .format (prefix ))
14771477 self ._append_to_file ('{}if interval < 0.001:' .format (prefix ))
14781478 self ._append_to_file ('{} time.sleep(0.001 - interval)' .format (prefix ))
14791479 else :
0 commit comments