expyriment.misc.Clock

class expyriment.misc.Clock(sync_clock=None)[source]

Basic timing class.

Unit of time is milliseconds.

Methods

__init__(sync_clock=None)[source]

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()[source]

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

reset_stopwatch()[source]

“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, function=None)[source]

Wait for a certain amout of milliseconds.

Parameters:

waiting_time : int

time to wait in milliseconds

function : function, optional

function to repeatedly execute during waiting loop

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, function=None)[source]

Wait for a certain amount of minutes.

Parameters:

time_minutes : int

time to wait in minutes

function : function, optional

function to repeatedly execute during waiting loop

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, function=None)[source]

Wait for a certain amout of seconds.

Parameters:

time_sec : int

time to wait in seconds

function : function, optional

function to repeatedly execute during waiting loop

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