Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.11] gh-77771: Add enterabs example in sched (GH-92716) #100491

Merged
merged 1 commit into from
Dec 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Doc/library/sched.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,22 @@ Example::
... print(time.time())
... s.enter(10, 1, print_time)
... s.enter(5, 2, print_time, argument=('positional',))
... # despite having higher priority, 'keyword' runs after 'positional' as enter() is relative
... s.enter(5, 1, print_time, kwargs={'a': 'keyword'})
... s.enterabs(1_650_000_000, 10, print_time, argument=("first enterabs",))
... s.enterabs(1_650_000_000, 5, print_time, argument=("second enterabs",))
... s.run()
... print(time.time())
...
>>> print_some_times()
930343690.257
From print_time 930343695.274 positional
From print_time 930343695.275 keyword
From print_time 930343700.273 default
930343700.276
1652342830.3640375
From print_time 1652342830.3642538 second enterabs
From print_time 1652342830.3643398 first enterabs
From print_time 1652342835.3694863 positional
From print_time 1652342835.3696074 keyword
From print_time 1652342840.369612 default
1652342840.3697174


.. _scheduler-objects:

Expand Down