Time.sleep() is not working :(

i’m not sure if this is the right category to ask this, i just joined, so i’m not sure.

I wanted to use time.sleep() in my code, but every time i run the scripts, it makes blender lag for a long period of time, to the point where it just crashes, is there a fix to this? or any alternative?

Thanks

Welcome to BA :slight_smile:

This is what time.sleep does- it stops the event loop until the timer expires, which means nothing can happen, update, or be interacted with. You should never use time.sleep() for this reason, use this instead:
https://docs.blender.org/api/current/bpy.app.timers.html

1 Like

OOOHHHHHhhhhh,
make sense now,
Thank you so much,

1 Like