MCPcopy Create free account
hub / github.com/EryiXie/PlaneRecNet / env

Class env

utils/timer.py:145–161  ·  view source on GitHub ↗

A class that lets you go: with timer.env(fn_name): # (...) That automatically manages a timer start and stop for you.

Source from the content-addressed store, hash-verified

143
144
145class env:
146 """
147 A class that lets you go:
148 with timer.env(fn_name):
149 # (...)
150 That automatically manages a timer start and stop for you.
151 """
152
153 def __init__(self, fn_name, use_stack=True):
154 self.fn_name = fn_name
155 self.use_stack = use_stack
156
157 def __enter__(self):
158 start(self.fn_name, use_stack=self.use_stack)
159
160 def __exit__(self, e, ev, t):
161 stop(self.fn_name, use_stack=self.use_stack)
162

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected