##// END OF EJS Templates
profile: make the contextmanager object available to the callers...
marmoute -
r32786:0ead06d5 default
parent child Browse files
Show More
@@ -160,6 +160,7 b' class profile(object):'
160 self._entered = True
160 self._entered = True
161 if self._enabled:
161 if self._enabled:
162 self.start()
162 self.start()
163 return self
163
164
164 def start(self):
165 def start(self):
165 """Start profiling.
166 """Start profiling.
@@ -230,5 +231,5 b' def maybeprofile(ui):'
230 just use a single code path for calling into code you may want to profile
231 just use a single code path for calling into code you may want to profile
231 and this function determines whether to start profiling.
232 and this function determines whether to start profiling.
232 """
233 """
233 with profile(ui, enabled=ui.configbool('profiling', 'enabled')):
234 with profile(ui, enabled=ui.configbool('profiling', 'enabled')) as p:
234 yield
235 yield p
General Comments 0
You need to be logged in to leave comments. Login now