Skip to content
Advertisement

How to update function by milliseconds in Kivy

I’m making a stopwatch using Kivy that includes “Minutes, seconds, milliseconds”.

But the problem is that the Clock method doesn’t seem to support the shorter time below 0.02. So no matter what numbers you give, it still can not catch up with the milliseconds’ change and counting time slower than the real-time (You can see it clearly in my code below).

So is there any better way to update my Kivy’s GUI by milliseconds, so I can display the numbers on my app’s screen?

Here’s the code I extracted from my main source:

JavaScript

Advertisement

Answer

I modified your .py code to the following which should fairly count upto milliseconds (should work without any changes in config).

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement