time.time() -plan.py
This commit is contained in:
@@ -186,10 +186,10 @@ class Plan(object):
|
|||||||
|
|
||||||
|
|
||||||
def _run(self):
|
def _run(self):
|
||||||
start = time.clock()
|
start = time.time()
|
||||||
line = 0
|
line = 0
|
||||||
maxLine = 0
|
maxLine = 0
|
||||||
maxLineTime = time.clock()
|
maxLineTime = time.time()
|
||||||
position = {axis: 0 for axis in 'xyz'}
|
position = {axis: 0 for axis in 'xyz'}
|
||||||
rapid = False
|
rapid = False
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ class Plan(object):
|
|||||||
line = cmd['value']
|
line = cmd['value']
|
||||||
if maxLine < line:
|
if maxLine < line:
|
||||||
maxLine = line
|
maxLine = line
|
||||||
maxLineTime = time.clock()
|
maxLineTime = time.time()
|
||||||
|
|
||||||
elif cmd['name'] == 'speed':
|
elif cmd['name'] == 'speed':
|
||||||
s = cmd['value']
|
s = cmd['value']
|
||||||
@@ -250,11 +250,11 @@ class Plan(object):
|
|||||||
|
|
||||||
elif cmd['type'] == 'dwell': self.time += cmd['seconds']
|
elif cmd['type'] == 'dwell': self.time += cmd['seconds']
|
||||||
|
|
||||||
if args.max_time < time.clock() - start:
|
if args.max_time < time.time() - start:
|
||||||
raise Exception('Max planning time (%d sec) exceeded.' %
|
raise Exception('Max planning time (%d sec) exceeded.' %
|
||||||
args.max_time)
|
args.max_time)
|
||||||
|
|
||||||
if args.max_loop < time.clock() - maxLineTime:
|
if args.max_loop < time.time() - maxLineTime:
|
||||||
raise Exception('Max loop time (%d sec) exceeded.' %
|
raise Exception('Max loop time (%d sec) exceeded.' %
|
||||||
args.max_loop)
|
args.max_loop)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user