Skip to content

Commit 4bc8564

Browse files
committed
Add API reset_stats
1 parent 61afe6e commit 4bc8564

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

line_profiler/_line_profiler.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ cdef class LineProfiler:
360360
self._c_last_time[threading.get_ident()].clear()
361361
unset_trace()
362362

363+
def reset_stats(self):
364+
it = self._c_code_map.begin()
365+
while it != self._c_code_map.end():
366+
cython.operator.dereference(it).second.clear()
367+
cython.operator.preincrement(it)
368+
363369
def get_stats(self):
364370
"""
365371
Return a LineStats object containing the timings.

0 commit comments

Comments
 (0)