tools: switch time.clock() to time.perf_counter()

toolbox.py:86: DeprecationWarning: time.clock has been deprecated in Python
3.3 and will be removed from Python 3.8: use time.perf_counter or
time.process_time instead

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2019-02-18 09:37:22 +10:00
committed by Benjamin Tissoires
parent 13656b60f7
commit 3392b5e276

View File

@@ -83,8 +83,8 @@ def start_ratbagd(verbosity=0):
dbus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
name_owner = None
start_time = time.clock()
while name_owner is None and time.clock() - start_time < 30:
start_time = time.perf_counter()
while name_owner is None and time.perf_counter() - start_time < 30:
proxy = Gio.DBusProxy.new_sync(dbus,
Gio.DBusProxyFlags.NONE,
None,