dgs.utils.timer.DifferenceTimer

class dgs.utils.timer.DifferenceTimer[source]

A simple timer based on time differences, with a few helper functions.

__init__() None[source]

Methods

add(prev_time[, now])

Append the difference between a previous time and the current time to this timer.

append(item)

S.append(value) -- append value to the end of the sequence

average()

Return the average time in seconds.

avg_hms()

Get the total average time and return it as str with HH:MM:SS.

clear()

copy()

count(value)

extend(other)

S.extend(iterable) -- extend sequence by appending elements from the iterable

index(value, [start, [stop]])

Raises ValueError if the value is not present.

insert(i, item)

S.insert(index, value) -- insert value before index

pop([index])

Raise IndexError if list is empty or index is out of range.

print(name, prepend[, hms])

Generate string for printing, containing average and total time.

remove(item)

S.remove(value) -- remove first occurrence of value.

reverse()

S.reverse() -- reverse IN PLACE

sort(*args, **kwds)

sum()

Return the absolute sum of all the individual timings in seconds.

sum_hms()

Get the summed-up time and return it as str with HH:MM:SS.

Attributes

data

A list containing time differences in seconds.