The Clock object allow you to schedule a function call. The scheduling can be repetitive or just once.
You can add new event like this:
def my_callback(dt):
pass
# call my_callback every 0.5 seconds
Clock.schedule_interval(my_callback, 0.5)
# call my_callback in 5 seconds
Clock.schedule_once(my_callback, 5)
# call my_callback as soon as possible (usually next frame.)
Clock.schedule_once(my_callback)
Note
If the callback return False, the schedule will be removed.
Instance of the ClockBase, available for everybody
Bases: object
A clock object, that support events
Time spended between last frame and current frame (in seconds)
Get the current FPS calculated by the clock
Get the current “real” FPS calculated by the clock. This counter reflect the real frame displayed on the screen.
In contrary to get_fps(), this function return a counter of the number of frame, not a average of frame per seconds
Get the last tick made by the clock
Schedule a event to be call every <timeout> seconds
Schedule an event in <timeout> seconds
Advance clock to the next step. Must be called every frame. The default clock have the tick() function called by Kivy
Tick the drawing counter
Remove a previous schedule event