package timed
Install
Dune Dependency
Authors
Maintainers
Sources
md5=06106626006450f41f0c4d4fcbcf95d0
sha512=b136d79e6ad1a50c811acadc0ae0be049f2dc0d6fc87d233400d602cdf8c6dab3af87557e8f8d740f6eba4b87b9d5b2fcc7e550d24e4ba8c03237573da5623d5
doc/timed.compat/Timed_compat/Time/index.html
Module Timed_compat.Time
Source
The Time
module provides an abstract representation of time, used to set a point from which (monitored) updates to references are recorded to allow undoing/redoing the corresponding changes.
Point in the “timeline” of the program's execution.
save ()
registers the position of the program in its “timeline”. The returned value can then be used to “time-travel” toward this point, by calling restore
. The saving operation runs in constant time. In the process one block of memory of three words is allocated. Note that two consecutive calls to save
(i.e., with no interleaved (:=)
or restore
) return the same value, and the second one does not allocate any memory.
restore t
has the effect of “traveling in time” towards a previously recorded point t
. After calling this function, (monitored) reference updates made between t
and the “current time” are undone. Note that the time and memory complexity of this function is proportional to the number of (monitored) updates between t
and the current time.