We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 87b1f29 + 298cfc8 commit 7a5bf7aCopy full SHA for 7a5bf7a
examples/rgb_display_pillow_animated_gif.py
@@ -126,14 +126,16 @@ def play(self):
126
return False
127
while True:
128
for frame_object in self._frames:
129
+ start_time = time.monotonic()
130
self.display.image(frame_object.image)
131
if not self.advance_button.value:
132
self.advance()
133
134
if not self.back_button.value:
135
self.back()
136
- time.sleep(frame_object.duration / 1000)
137
+ while time.monotonic() < (start_time + frame_object.duration / 1000):
138
+ pass
139
140
if self._loop == 1:
141
return True
0 commit comments