Skip to content

Commit

Permalink
Merge pull request #113 from gnikit/feat/new-timmings
Browse files Browse the repository at this point in the history
fix: replace time() with perf_counter()
  • Loading branch information
gnikit authored Nov 17, 2024
2 parents 9a1500e + 05aeb2c commit ee8df97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tktooltip/tooltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def on_enter(self, event: tk.Event) -> None:
"""
Processes motion within the widget including entering and moving.
"""
self.last_moved = time.time()
self.last_moved = time.perf_counter()
self.status = ToolTipStatus.INSIDE
self._update_tooltip_coords(event)
self.after(int(self.delay * self.S_TO_MS), self._show)
Expand Down Expand Up @@ -177,7 +177,7 @@ def _show(self) -> None:
"""
if (
self.status == ToolTipStatus.INSIDE
and time.time() - self.last_moved >= self.delay
and time.perf_counter() - self.last_moved >= self.delay
):
self.status = ToolTipStatus.VISIBLE

Expand Down

0 comments on commit ee8df97

Please sign in to comment.