Closed lishanl closed 8 months ago
I want to reuse the time measurement for other connection test as well, so I made it a decorator in the utils
any comment ant @hillairet ?
@lishanl Here is an idea, just to get you thinking.
You could make a time class with the time stored in _time
to show that it's not supposed to be accessed directly. Then add the properties s()
and ms()
this way you don't need to carry the unit in the name of the variable.
Or a less dumb idea: Use the timedelta
class from datetime
Or a less dumb idea: Use the
timedelta
class fromdatetime
I tried timedelta
, it oddly doesn't have milliseconds
attributes.
Or a less dumb idea: Use the
timedelta
class fromdatetime
I tried
timedelta
, it oddly doesn't havemilliseconds
attributes.
Hummmmm I thought I saw it. :dizzy_face: One could extend the class to add this property but since the perf_counter is returning float time, timedelta doesn't make sense for this purpose anyway. So it was actually a dumber idea! :sweat_smile:
I guess it's about time not to ignore the speed of connection as well. 😅