@contextlib.contextmanager<EOL>def maintained_time():
ct = cmds.currentTime(query=True)<EOL>try:<EOL><INDENT>yield<EOL><DEDENT>finally:<EOL><INDENT>cmds.currentTime(ct, edit=True)<EOL><DEDENT>
Maintain current time during context

    Example:
        >>> with maintained_time():
        ...    cmds.playblast()
        >>> # Time restored