Galaxie EveLoop 0.1.5 documentation


Navigation:   | Index   | Search   | Top   | Up   | Prev   |
Table of Content: |glxeveloop.timer module |Timer |Timer.DEFAULT_BE_FAST_MULTIPLICATOR |Timer.MIN_BE_FAST_MULTIPLICATOR |Timer.SPEED_STEP_PERCENTAGE |Timer.be_fast |Timer.be_fast_multiplication |Timer.fps |Timer.fps_accelerated |Timer.queue |Timer.tick() |Timer.time |Timer.time_departure |

© Copyright 2021-2024, Galaxie EveLoop Team all right reserved.

Top » glxeveloop » glxeveloop package » glxeveloop.timer module

glxeveloop.timer module

class glxeveloop.timer.Timer[source]

Bases: DebugProperty

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.

SPEED_STEP_PERCENTAGE = 10
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_multiplication

Return the be_fast_multiplication property value

Returns:

be_fast_multiplication property

Return type:

int

property fps

The FPS object

Returns:

fps property value. (in fps)

Return type:

FPS

property fps_accelerated
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 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

Top » glxeveloop » glxeveloop package » glxeveloop.timer module

© Copyright 2021-2024, Galaxie EveLoop Team all right reserved.
This page is licensed under the GNU General Public License v3 or later (GPLv3+).
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.

Last updated on None.
Created using Sphinx 7.3.7.