hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 2ac46dee05b1df152fa0a1a53e59ad45ff039c6f
parent d4cb2309bcb8de35695adcc9bdb31a8b115d424b
Author: Alexey Yerin <yyp@disroot.org>
Date:   Wed, 13 Oct 2021 12:09:29 +0300

time: add documentation for constants

They are an important when dealing with durations, so they should be
visible in haredoc and on docs.harelang.org.

Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mtime/types.ha | 23+++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/time/types.ha b/time/types.ha @@ -2,12 +2,23 @@ // representable duration is about 290 years. export type duration = i64; -export def NANOSECOND: duration = 1; -export def MICROSECOND: duration = 1000 * NANOSECOND; -export def MILLISECOND: duration = 1000 * MICROSECOND; -export def SECOND: duration = 1000 * MILLISECOND; -export def MINUTE: duration = 60 * SECOND; -export def HOUR: duration = 60 * MINUTE; +// [[duration]] representing a single nanosecond. +export def NANOSECOND: duration = 1; + +// [[duration]] representing a single microsecond. +export def MICROSECOND: duration = 1000 * NANOSECOND; + +// [[duration]] representing a single millisecond. +export def MILLISECOND: duration = 1000 * MICROSECOND; + +// [[duration]] representing a second. +export def SECOND: duration = 1000 * MILLISECOND; + +// [[duration]] representing a minute. +export def MINUTE: duration = 60 * SECOND; + +// [[duration]] representing an hour. +export def HOUR: duration = 60 * MINUTE; // Represents a specific instant in time as seconds (+nanoseconds) since an // arbitrary epoch. Instants may only be meaningfully compared with other