Module timeslots

Module timeslots 

Source
Expand description

management of the relation between time and slots warning: assumes thread_count >= 1, t0_millis >= 1, t0_millis % thread_count == 0

Functionsยง

get_block_slot_timestamp
Gets timestamp in milliseconds for given slot.
get_closest_slot_to_timestamp
TODO DOC
get_current_latest_block_slot
Returns the thread and block slot index of the current block slot (inclusive), if any happened yet
get_latest_block_slot_at_timestamp
Returns the thread and block period index of the latest block slot at a given timestamp (inclusive), if any happened
slot_count_in_range
Counts the number of slots in a slot range [a, b)
time_range_to_slot_range
Turns an MassaTime range [start, end) with optional start/end to a Slot range [start, end) with optional start/end