Copyright | (c) George Ungureanu KTH/ICT/ESY 2016 |
---|---|

License | BSD-style (see the file LICENSE) |

Maintainer | ugeorge@kth.se |

Stability | experimental |

Portability | portable |

Safe Haskell | Safe |

Language | Haskell2010 |

This module implements a timestamp data type, based on Data.Time.Clock.

# Documentation

type TimeStamp = DiffTime Source #

Alias for the type representing discrete time. It is inherently quantizable, the quantum being a picosecond ( \(10^{-12}\) seconds), thus it can be considered order-isomorphic with a set of integers, i.e. between any two timestamps there is a finite number of timestamps. Moreover, a timestamp can be easily translated into a rational number representing fractions of a second, so the conversion between timestamps (discrete time) and rationals (analog/continuous time) is straightforward.

This type is used in the explicit tags of the
`DE`

MoC (and subsequently the discrete event
evaluation engine for simulating the `CT`

MoC).

toTime :: TimeStamp -> Rational Source #

Converts a timestamp to a rational number, used for describing continuous time.