Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log execution time of scene rendering in the Manim Checkhealth command #3855

Merged
merged 3 commits into from
Jul 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions manim/cli/checkhealth/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
from __future__ import annotations

import sys
import time

import click
import cloup

from .checks import HEALTH_CHECKS
from manim.cli.checkhealth.checks import HEALTH_CHECKS

__all__ = ["checkhealth"]

Expand Down Expand Up @@ -62,7 +63,13 @@ def checkhealth():
import manim as mn

class CheckHealthDemo(mn.Scene):
def __init__(self):
super().__init__()
self.execution_time = None

def construct(self):
start = time.time()

banner = mn.ManimBanner().shift(mn.UP * 0.5)
self.play(banner.create())
self.wait(0.5)
Expand All @@ -79,5 +86,10 @@ def construct(self):
mn.FadeOut(text_tex_group, shift=mn.DOWN),
)

self.execution_time = time.time() - start

with mn.tempconfig({"preview": True, "disable_caching": True}):
CheckHealthDemo().render()
scene = CheckHealthDemo()
scene.render()

click.echo(f"Scene rendered in {scene.execution_time:.2f} seconds.")
Loading