diff options
author | Walter Bender <walter@sugarlabs.org> | 2010-11-28 04:01:52 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2010-11-28 04:01:52 (GMT) |
commit | 8e82812142c30d07f66a6e39d5b7707af594fd9e (patch) | |
tree | 07da80d08c0dc3d319471e1623cd5da2a81ff89a /TurtleArt/talogo.py | |
parent | f046bf0351330721d9e154d89e3a0d204354f359 (diff) |
switching from clock() to time() and int to float to fix overflow problem (#2489)
Diffstat (limited to 'TurtleArt/talogo.py')
-rw-r--r-- | TurtleArt/talogo.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index ee92e1f..61db3a2 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -23,7 +23,7 @@ import gtk -from time import clock, sleep +from time import clock, sleep, time from math import sqrt from numpy import append from numpy.fft import rfft @@ -296,7 +296,7 @@ def _just_stop(): def _millisecond(): """ Current time in milliseconds """ - return int(clock() * 1000) + return time() * 1000 # clock() * 1000. class LogoCode: @@ -703,7 +703,7 @@ class LogoCode: # In debugging modes, we pause between steps and show the turtle. if self.tw.step_time > 0: self.tw.active_turtle.show() - endtime = _millisecond() + self._int(self.tw.step_time) * 100 + endtime = _millisecond() + self.tw.step_time * 100. sleep(self.tw.step_time / 10) while _millisecond() < endtime: yield True @@ -871,7 +871,7 @@ class LogoCode: def _prim_wait(self, time): """ Show the turtle while we wait """ self.tw.active_turtle.show() - endtime = _millisecond() + self._int(time * 1000) + endtime = _millisecond() + time * 1000. sleep(time) while _millisecond() < endtime: yield True |