INNER CODE UNIT · Python
ScopedZoneDecorator
Hekbas/Luth · luth/extern/source/tracy/python/tracy_client/scoped.py:50
def ScopedZoneDecorator(
name: Optional[str] = None,
color: Color = 0,
depth: Optional[int] = None,
active: bool = True,
class_name: Optional[str] = None,
):
def decorator(function: Callable):
if not is_enabled():
return function
source = function.__name__
if class_name is not None:
source = f"{class_name}:{source}"
zone = _ScopedZone(
name,