glxeveloop.timer module

class glxeveloop.timer.Timer[source]

Bases: object

SPEED_STEP_PERCENTAGE = 10
DEFAULT_BE_FAST_MULTIPLICATOR = 100
MIN_BE_FAST_MULTIPLICATOR = 0
Description

The Timer object contain a self-correcting timing algorithms.

That self-correcting timing algorithms have associated property’s it permit to control the Timer object.

The power saving happen that because the loop try to limit the number of mainloop cycle The Timer object update value itself and can be requested, via internal method’s.

property debug
property fps

The FPS object

Returns

fps property value. (in fps)

Return type

FPS

property queue

Store the Timer Buffer object.

Returns

TimerBuffer instance

Return type

Memory

tick()[source]

Return True or False “when necessary” , that mean according with all the self-correcting timing algorithms and they configuration property’s

timer = Timer()
while True:
    # Do stuff that might take significant time here

    if timer.tick():
        print('Hello World!')
Returns

True when it’s time or False if a adjustment job of fps property should be done

Return type

bool

property fps_accelerated
property time

Time should be take as a serious thing, you should try to impose only one time source in you program, then the Timer Class provide it own method for get the time by it self.

Returns

Unix time

Return type

int

property time_departure

Return the value set by a Timer._set_departure_time()

Returns

return departure_time property.

Return type

Unix time

property be_fast

Return the value set by Timer._set_be_fast() method.

You can set __be_fast property with

Timer._set_be_fast() method. :return: __be_fast property :rtype: bool

property be_fast_multiplicator

Return the be_fast_multiplicator property value

Returns

__be_fast_multiplicator property

Return type

int