Skip to content

Commit

Permalink
Fix 'time.clock' which deprecated since python3.3 and was removed in …
Browse files Browse the repository at this point in the history
…python3.8 (mhammond#1922)
  • Loading branch information
amchii authored Aug 13, 2022
1 parent 5c0b62b commit b233706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions com/win32com/demos/eventsApartmentThreaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def OnQuit(self):


def WaitWhileProcessingMessages(event, timeout=2):
start = time.clock()
start = time.perf_counter()
while True:
# Wake 4 times a second - we can't just specify the
# full timeout here, as then it would reset for every
Expand All @@ -59,7 +59,7 @@ def WaitWhileProcessingMessages(event, timeout=2):
if rc == win32event.WAIT_OBJECT_0:
# event signalled - stop now!
return True
if (time.clock() - start) > timeout:
if (time.perf_counter() - start) > timeout:
# Timeout expired.
return False
# must be a message.
Expand Down

0 comments on commit b233706

Please sign in to comment.