pysted.base.Clock

class pysted.base.Clock(time_quantum_us)

Clock class to keep track of time in experiments involving time

Parameters:

time_quantum_us – The minimal time increment on which the experiment loop will happen. All other time increments in the experiment should be a multiple of this value (in micro seconds (us)) (int)

Note

The time_quantum_us is an int and so is the current_time attribute. This means the longest time an experiment can last is determined by the size of the biggest int64, which means it is 9223372036854775807 us, or 9223372036854.775807 s, which I think should be ample time :)

Clock.reset()

Resets the current_time to 0

Clock.update_time()

Updates the current_time by 1 time_quantum_us