## time.api
# Compiled by:
#
src/lib/std/src/standard-core.sublib### "Eternity is a very long time, especially towards the end."
###
### -- Stephen Hawking
stipulate
herein
# Implemented in:
#
src/lib/std/src/time-guts.pkg #
api Time {
#
eqtype Time;
exception TIME;
zero_time: Time;
to_seconds: Time -> multiword_int::Int; from_seconds: multiword_int::Int -> Time;
to_milliseconds: Time -> multiword_int::Int; from_milliseconds: multiword_int::Int -> Time;
to_microseconds: Time -> multiword_int::Int; from_microseconds: multiword_int::Int -> Time;
to_nanoseconds: Time -> multiword_int::Int; from_nanoseconds: multiword_int::Int -> Time;
to_string: Time -> String;
to_float_seconds: Time -> Float;
from_string: String -> Null_Or(Time);
from_float_seconds: Float -> Time;
+ : (Time, Time) -> Time;
- : (Time, Time) -> Time;
compare: (Time, Time) -> Order;
< : (Time, Time) -> Bool;
<= : (Time, Time) -> Bool;
> : (Time, Time) -> Bool;
>= : (Time, Time) -> Bool;
get_current_time_utc: Void -> Time;
# Format time as a string.
# First argument is precision:
#
# eval: time::format 0 (time::get ());
#
# "1258134720"
#
# eval: time::format 4 (time::get ());
#
# "1258134742.5852"
#
# eval: time::format 6 (time::get ());
#
# "1258134732.273621"
#
# For more date formatting
# see date::strftime () in
#
#
src/lib/std/src/date.api #
format: Int -> Time -> String;
# Scan a time value.
# Supported syntax is:
#
# [+-~]?([0-9]+(.[0-9]+)?
| .[0-9]+)
#
scan: number_string::Reader (Char, X) -> number_string::Reader (Time, X);
}; # The End of Time.
end;
## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.