Update/tick function in Motionbuilder?

Hi all,
I’m new to python scripting, but I know how to program in other languages. I’m currently working in Motionbuilder right now. But is there a update/tick function in Motionbuilder that’s calls every few seconds?
I tried a while loop but that kills Motionbuilder.