diff options
Diffstat (limited to 'doc/python_api/examples/bpy.app.timers.3.py')
-rw-r--r-- | doc/python_api/examples/bpy.app.timers.3.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.app.timers.3.py b/doc/python_api/examples/bpy.app.timers.3.py new file mode 100644 index 00000000000..79daf6a7740 --- /dev/null +++ b/doc/python_api/examples/bpy.app.timers.3.py @@ -0,0 +1,17 @@ +""" +Run a Function n times every x seconds +-------------------------------------- +""" +import bpy + +counter = 0 + +def run_10_times(): + global counter + counter += 1 + print(counter) + if counter == 10: + return None + return 0.1 + +bpy.app.timers.register(run_10_times) |