expyriment.misc.Clock

class expyriment.misc.Clock(sync_clock=None)

Basic timing class.

Unit of time is milliseconds.

__init__(sync_clock=None)

Create a clock.

Parameters:

sync_clock : misc.Clock, optional

synchronise clock with existing one

cpu_time

Getter for CPU time.

init_localtime

Getter for init time in local time

init_time

Getter for init time in milliseconds.

static monotonic_time()

Returns the time of the high-resolution monitonoic timer that is used by Expyriment interally.

reset_stopwatch()

“Reset the stopwatch.

The use of the stopwatch does not affect the clock time.

stopwatch_time

Getter for time in milliseconds since last reset_stopwatch.

The use of the stopwatch does not affect the clock time.

time

Getter for current time in milliseconds since clock init.

wait(waiting_time, callback_function=None, process_control_events=False)

Wait for a certain amount of milliseconds.

Parameters:

waiting_time : int

time to wait in milliseconds

function : function, optional

function to repeatedly execute during waiting loop

process_control_events : bool, optional

process io.Keyboard.process_control_keys() and io.Mouse.process_quit_event() (default = False)

Returns:

quit_event : expyriment.control.CallbackQuitEvent object

the callback quit even in case a wait function has been registered

See also

design.experiment.register_wait_callback_function

wait_minutes(time_minutes, callback_function=None, process_control_events=False)

Wait for a certain amount of minutes.

Parameters:

time_minutes : int

time to wait in minutes

callback_function : function, optional

function to repeatedly execute during waiting loop

process_control_events : bool, optional

process io.Keyboard.process_control_keys() and io.Mouse.process_quit_event() (default = False)

Returns:

quit_event : expyriment.control.CallbackQuitEvent object

the callback quit even in case a wait function has been registered

See also

Clock.wait, design.experiment.register_wait_callback_function

wait_seconds(time_sec, callback_function=None, process_control_events=False)

Wait for a certain amout of seconds.

Parameters:

time_sec : int

time to wait in seconds

callback_function : function, optional

function to repeatedly execute during waiting loop

process_control_events : bool, optional

process io.Keyboard.process_control_keys() and io.Mouse.process_quit_event() (default = False)

Returns:

quit_event : expyriment.control.CallbackQuitEvent object

the callback quit even in case a wait function has been registered

See also

Clock.wait, design.experiment.register_wait_callback_function