An ExecutionTime holds an integer value to be used for time stamps. As such it is not related to any kind of real time, but just as a value which is incremented by one whenever an event of interest happens. What kind of event this is depends on the context in which the ExecutionTime is used. For example, it might be a modification counter of some data which is incremented whenever the data is changed.
ExecutionTime has only a single operation, namely ++ to increment the value. TimeStamp objects can then be used to save the value of an ExecutionTime at a certain instant, and to check if the ExecutionTime has changed in the meantime. I.e., in the use case of a data modification counter, you use a single ExecutionTime for the original data. For each dependent data which has to be re-computed when the original data changes, you use a TimeStamp value which stores the ExecutionTime when the dependent data has been updated the last time.
One could also use Int values directly for execution times and time stamps, but these wrapper classes make the purpose of the values clearer, and they only allow the meaningful operations which makes them safer.
- See also
- TimeStamp