profiler

class janim.render.profiler.RenderProfiler(callback: Callable[[FrameRecord], Any])

基类:object

性能分析器

用于 patch 物件渲染,统计物件渲染的耗时与性能

参数:

callback -- 用于接收结果的回调函数,接收一个 FrameRecord 参数

record_frame()

在渲染顶层入口 with 该函数,统计内部代码块的物件用时,并将结果传递给 callback 回调

class janim.render.profiler.FrameRecord(timestamp: float, elapsed: float, times: list[tuple[str, float]])

基类:object

各个种类物件在单帧中的耗时统计

timestamp: float
elapsed: float
times: list[tuple[str, float]]