forsyde-atom-0.3.0.0: Shallow-embedded DSL for modeling cyber-physical systems
Copyright(c) George Ungureanu KTH/ICT/ESY 2016
LicenseBSD-style (see the file LICENSE)
Maintainerugeorge@kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

ForSyDe.Atom.MoC.TimeStamp

Description

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

Synopsis

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).

picosec :: Integer -> TimeStamp Source #

Specifies a timestamp in terms of picoseconds.

nanosec :: Integer -> TimeStamp Source #

Specifies a timestamp in terms of nanoseconds.

microsec :: Integer -> TimeStamp Source #

Specifies a timestamp in terms of microseconds.

milisec :: Integer -> TimeStamp Source #

Specifies a timestamp in terms of miliseconds.

sec :: Integer -> TimeStamp Source #

Specifies a timestamp in terms of seconds.

minutes :: Integer -> TimeStamp Source #

Specifies a timestamp in terms of minutes.

hours :: Integer -> TimeStamp Source #

Specifies a timestamp in terms of hours.

toTime :: TimeStamp -> Rational Source #

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

pi :: TimeStamp Source #

TimeStamp representation of the number π. Converted from the Prelude equivalent, which is Floating.

Orphan instances

Read DiffTime Source #

reads [n]s as a fraction of a second, where [n] is a floating point number.

Instance details