Type for binary (integeral) representation of a 64-bit Ntp timestamp (ie. ntpi). The Ntp epoch is January 1, 1900. Ntp v4 also includes a 128-bit format, which is not used by Osc.
Modulehosc-0.20Haskell2010
Sound.Osc.Time
Osc related timing functions.
Osc timestamps are 64-bit Ntp values, http://ntp.org/.
- 3 types
- 14 values
- Packagehosc-0.20
- Exports17
- LanguageHaskell2010
- LicenceGPL-3.0-only
- SourceTime.hs
Temporal types
3 declarationsNtp time in real-valued (fractional) form.
Unix/Posix time in real-valued (fractional) form.
The Unix/Posix epoch is January 1, 1970.
Time conversion
9 declarationsConvert an NtpReal timestamp to an Ntp64 timestamp.
ntpr_to_ntpi 0 == 0
fmap ntpr_to_ntpi timeConvert an Ntp64 timestamp to a real-valued Ntp timestamp.
ntpi_to_ntpr 0 == 0.0Difference (in seconds) between Ntp and Posix epochs.
ntp_posix_epoch_diff / (24 * 60 * 60) == 25567
25567 `div` 365 == 70Convert a PosixReal timestamp to an Ntp64 timestamp.
Convert Unix/Posix to Ntp.
Convert Ntp to Unix/Posix.
Convert Ntp64 to Unix/Posix.
Convert Time to POSIXTime.
Convert POSIXTime to Time.
Data.Time inter-operation.
2 declarationsThe time at 1970-01-01:00:00:00 which is the Unix/Posix epoch.
Convert UTCTime to Unix/Posix.
Clock operations
3 declarationsutc_to_posix of Clock.getCurrentTime.
realToFrac of Clock.Posix.getPOSIXTime
get_ct = getCurrentTimeAsPosix
get_pt = getPosixTimeAsPosix
(ct,pt) <- get_ct >>= \t0 -> get_pt >>= \t1 -> return (t0,t1)
print (pt - ct,pt - ct < 1e-5)Read current real-valued Ntp timestamp.