/usr/share/pyshared/pyepl/timing.py is in python-pyepl 1.1.0+git12-g365f8e3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # PyEPL: timing.py
#
# Copyright (C) 2003-2005 Michael J. Kahana
# Authors: Ian Schleifer, Per Sederberg, Aaron Geller, Josh Jacobs
# URL: http://memory.psych.upenn.edu/programming/pyepl
#
# Distributed under the terms of the GNU Lesser General Public License
# (LGPL). See the license.txt that came with this file.
"""
This module provides high-level timing features.
"""
import hardware
import exputils
now = hardware.universal_time
timedCall = hardware.timedCall
def timedCall(t, f, *targs, **dargs):
"""
At time t, call f with any remaining arguments. Returns a 2-tuple
of a timestamp for the time and maximum latency of the actual call
to f, and the return value of the call. If t is None or 0, the
call is made immediately.
INPUT ARGS:
t- time at which to execute call. This can be specified as an
integer specifying a millisecond time to run,
OR as a PresentationClock object.
f- a callable to run at the specified time
args- arguments to pass to f when it is called.
"""
if isinstance(t, exputils.PresentationClock):
return hardware.timedCall(t.get(), f, *targs, **dargs)
return hardware.timedCall(t, f, *targs, **dargs)
delay = hardware.delay
wait = hardware.wait
|