Application.utils#
Attributes#
Classes#
Handcuffs |
|
terrible, utterly horrendous. doesn't even store the return values lmao |
|
Basic timer utility. |
Functions#
|
Converts a time in seconds to a 6-padded scaled unit |
Module Contents#
- Application.utils.logger#
- Application.utils.natural_time(time_in_seconds: float) str#
Converts a time in seconds to a 6-padded scaled unit E.g.:
1.5000 -> 1.50 s 0.1000 -> 100.00 ms 0.0001 -> 100.00 us
- class Application.utils.ShittyMultiThreading(work, tasks, num_threads=5)#
terrible, utterly horrendous. doesn’t even store the return values lmao
- work#
- num_threads = 5#
- queue#
- worker()#
- start()#
- class Application.utils.SimpleTimer(process_name=None, log=False)#
Basic timer utility.
This is for when you want to see just how incredibly inefficient your pile of shit it.
Example#
Timing something and printing the total time as a formatted string:
with SimpleTimer("Test Timer") as timer: ... print(timer)
- start = 0#
- time = 0#
- name = None#
- log = False#
- __enter__()#
- __exit__(*args)#
- __str__()#