Skip to content

Commit ee8df97

Browse files
authored
Merge pull request #113 from gnikit/feat/new-timmings
fix: replace time() with perf_counter()
2 parents 9a1500e + 05aeb2c commit ee8df97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tktooltip/tooltip.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def on_enter(self, event: tk.Event) -> None:
134134
"""
135135
Processes motion within the widget including entering and moving.
136136
"""
137-
self.last_moved = time.time()
137+
self.last_moved = time.perf_counter()
138138
self.status = ToolTipStatus.INSIDE
139139
self._update_tooltip_coords(event)
140140
self.after(int(self.delay * self.S_TO_MS), self._show)
@@ -177,7 +177,7 @@ def _show(self) -> None:
177177
"""
178178
if (
179179
self.status == ToolTipStatus.INSIDE
180-
and time.time() - self.last_moved >= self.delay
180+
and time.perf_counter() - self.last_moved >= self.delay
181181
):
182182
self.status = ToolTipStatus.VISIBLE
183183

0 commit comments

Comments
 (0)