You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

asyncgui-ext-clock

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asyncgui-ext-clock

An event scheduler for asyncgui programs

0.6.0
pipPyPI
Maintainers
1

Clock

Provides async time-related functionality.

import asyncgui
from asyncgui_ext.clock import Clock

clock = Clock()

async def async_fn():
    await clock.sleep(20)  # Waits for 20 time units
    print("Hello")

asyncgui.start(async_fn())
clock.tick(10)  # Advances the clock by 10 time units.
clock.tick(10)  # Total of 20 time units. The async_fn will wake up, and prints 'Hello'.

The example above effectively illustrate how this module works but it's not practical. In a real-world program, you probably want to call clock.tick() in a main loop. For example, if you are using PyGame, you may want to do:

pygame_clock = pygame.time.Clock()
clock = asyncgui_ext.clock.Clock()

# main loop
while running:
    ...

    dt = pygame_clock.tick(fps)
    clock.tick(dt)

Installation

Pin the minor version.

poetry add asyncgui-ext-clock@~0.6
pip install "asyncgui-ext-clock>=0.6,<0.7"

Tested on

  • CPython 3.10
  • CPython 3.11
  • CPython 3.12
  • CPython 3.13
  • PyPy 3.10

Keywords

async

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts