Application.utils#

Attributes#

Classes#

Singleton

Handcuffs

ShittyMultiThreading

terrible, utterly horrendous. doesn't even store the return values lmao

SimpleTimer

Basic timer utility.

Functions#

natural_time(→ str)

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.Singleton#

Bases: type

Handcuffs

_instances#
__call__(*args, **kwargs)#
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__()#