Debian Codegraph @

time/duration.ha

raw
1 // SPDX-License-Identifier: MPL-2.0
2 // (c) Hare authors <https://harelang.org>
3
4 // The elapsed time between two instants, in nanoseconds. The largest
5 // representable duration is about 290 years.
6 export type duration = i64;
7
8 // [[duration]] representing a single nanosecond.
9 export def NANOSECOND: duration = 1;
10
11 // [[duration]] representing a single microsecond.
12 export def MICROSECOND: duration = 1000 * NANOSECOND;
13
14 // [[duration]] representing a single millisecond.
15 export def MILLISECOND: duration = 1000 * MICROSECOND;
16
17 // [[duration]] representing a second.
18 export def SECOND: duration = 1000 * MILLISECOND;
19
20 // [[duration]] representing a minute.
21 export def MINUTE: duration = 60 * SECOND;
22
23 // [[duration]] representing an hour.
24 export def HOUR: duration = 60 * MINUTE;