dgs.utils.timer.DifferenceTimers¶
- class dgs.utils.timer.DifferenceTimers(names: list[str] | None = None)[source]¶
Object to store the information of multiple
DifferenceTimer
objects.- __init__(names: list[str] | None = None) None [source]¶
Methods
add
(name, prev_time[, now])Add a new time difference to the timer with the given name.
add_multiple
(prev_times)Add a bunch of new time differences to the respective timers.
clear
()copy
()fromkeys
(iterable[, value])get
(k[,d])get_avgs
()Return the average times for all timers.
get_last
()Return the last time difference for all timers.
get_sums
()Return the summed-up times for all timers.
items
()keys
()pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
()as a 2-tuple; but raise KeyError if D is empty.
print
(prepend[, hms])Generate a string for printing, containing average and total time for all timers.
setdefault
(k[,d])update
([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values
()Attributes