How to set a delegate callback

hi again.

I am using a class that is a cpp library. I set is up as a global variable and I can access it from the ui system using blender operators, panels and PropertyGroup
but the question that I have now, how can I get an update when I run the animation.
I don’t even know how to search for such question in the blender Docs.

so the question is:
Is there a system for hooking a Delegate function in blender that I can get the call with parameters, like the timestep, the scene and that sort of things, when the animation is run?

I do see this class

bpy.app.handlers. frame_change_pre

Called after frame change for playback and rendering, before any data is evaluated for the new frame. This makes it possible to change data and relations (for example swap an object to another mesh) for the new frame. Note that this handler is not to be used as ‘before the frame changes’ event. The dependency graph is not available in this handler, as data and relations may have been altered and the dependency graph has not yet been updated for that.

but I though, I ask before put time, and then find out if there is a proper way that every one uses, for example in teh docs ther is a demo that is quite close to what I need. it look like this

Basic Handler Example
This script shows the most simple example of adding a handler.


import bpy


def my_handler(scene):
    print("Frame Change", scene.frame_current)

bpy.app.handlers.frame_change_pre.append(my_handler)

the only part missing is the time step of the frame tick,
Julio.

import bpy

def my_handler(scene):
    print("Frame Change", scene.frame_current)
    f_fps = scene.render.fps / scene.render.fps_base
    timestep = 1.0/f_fps
    print("timestep", timestep)

bpy.app.handlers.frame_change_pre.append(my_handler)

ah yes that does it,
thank you very much.
this can be closed now.