time
time
time -- unit feature to group time related features
Constructors
time.calendar_duration -- value representing a duration in the ISO 8601
calendar
calendar
time.Clock -- class of effects that implement a clock
This is a `ref` feature such that code that requires an arbitrary `Clock`
effect could be written in a way that permits its execution using different
actual `Clock` implementations like `time.nano` that provides high
precision with low accuray or a different clock that provides higher accuracy.
This is a `ref` feature such that code that requires an arbitrary `Clock`
effect could be written in a way that permits its execution using different
actual `Clock` implementations like `time.nano` that provides high
precision with low accuray or a different clock that provides higher accuracy.
Represents a date and a time in the Gregorian calendar, without any specification of
a time zone or reference point.
a time zone or reference point.
time.duration -- value representing a duration, i.e., a time span
This is intended for high precision time specification and measurement, it
uses a time resolution of 1ns.
The maximum value is about 580 years, so this is not intended for use in
calendars that may require time spans exceeding several centuries or millennia,
nor astrological time spans.
This is intended for high precision time specification and measurement, it
uses a time resolution of 1ns.
The maximum value is about 580 years, so this is not intended for use in
calendars that may require time spans exceeding several centuries or millennia,
nor astrological time spans.
(title String, period option time.duration, max_recorded option time.duration, ignore_first u64, ignore_last u64):Any is¶
(title String, period option time.duration, max_recorded option time.duration, ignore_first u64, ignore_last u64)
:
Any is
¶time.histogram -- feature to collect and output timing data
This is particularly useful to analyse variations in release or
execution times of repeatedly executed tasks or events.
For this, it distributes time.duration values into a list of
buckets that correspond to different ranges of durations. These
buckets may be equally spaced (linear) or growing by an equal
factor (logarithmic).
The use of buckets permits the collection of large numbers of
sampe durations since only the counts per bucket are recorded
This is particularly useful to analyse variations in release or
execution times of repeatedly executed tasks or events.
For this, it distributes time.duration values into a list of
buckets that correspond to different ranges of durations. These
buckets may be equally spaced (linear) or growing by an equal
factor (logarithmic).
The use of buckets permits the collection of large numbers of
sampe durations since only the counts per bucket are recorded
time.instant -- abstract moment in time used for measuring durations
An instant is an absolute time relative to some fixed start of an epoch
that depends on the clock that created this instant.
NYI: UNDER DEVELOPMENT: we might want to add a reference to the clock that
created this instant and verify that `infix -` is called only on `instant`s
created by the same clock.
An instant is an absolute time relative to some fixed start of an epoch
that depends on the clock that created this instant.
NYI: UNDER DEVELOPMENT: we might want to add a reference to the clock that
created this instant and verify that `infix -` is called only on `instant`s
created by the same clock.
time.nano -- effect providing nano time
time.nano is a timer that provides high precision but possibly low
accuracy. Such a timer is typically useful for timing the duration
of events, such as measuring the time it takes to perform some
calculation.
time.nano may have a significant drift compared to actual time, it might
not be the right source of time to, e.g., feed an alarm clock that should
wake you up at 6h30 every morning.
time.nano is a timer that provides high precision but possibly low
accuracy. Such a timer is typically useful for timing the duration
of events, such as measuring the time it takes to perform some
calculation.
time.nano may have a significant drift compared to actual time, it might
not be the right source of time to, e.g., feed an alarm clock that should
wake you up at 6h30 every morning.
abstract handler that can deliver a nano time
effect for getting the current date_time
(smaller Lazy (option time.this.time_unit), larger Lazy (option time.this.time_unit), in_ns u64, short_name String, name String):Any is¶
(smaller Lazy (option time.this.time_unit), larger Lazy (option time.this.time_unit), in_ns u64, short_name String, name String)
:
Any is
¶time.duration.unit -- unit type defining units used in duration
time units used to present durations as Strings to humans to read
time units used to present durations as Strings to humans to read
Functions
create a String from this instance. Unless redefined, `a.as_string` will
create `"instance[T]"` where `T` is the dynamic type of `a`
create `"instance[T]"` where `T` is the dynamic type of `a`
Get the dynamic type of this instance. For value instances `x`, this is
equal to `type_of x`, but for `x` with a `ref` type `x.dynamic_type` gives
the actual runtime type, while `type_of x` results in the static
compile-time type.
There is no dynamic type of a type instance since this would result in an
endless hierarchy of types. So for Type values, dynamic_type is redefined
to just return Type.type.
equal to `type_of x`, but for `x` with a `ref` type `x.dynamic_type` gives
the actual runtime type, while `type_of x` results in the static
compile-time type.
There is no dynamic type of a type instance since this would result in an
endless hierarchy of types. So for Type values, dynamic_type is redefined
to just return Type.type.
get the current date_time.
Uses currently installed time.now effect
or installs the default_now handler
Uses currently installed time.now effect
or installs the default_now handler
convenience prefix operator to create a string from a value.
This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.
This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.
stopwatch measures the execution duration of f
Type Functions
string representation of this type to be used for debugging.
result has the form "Type of '<name>'", but this might change in the future
result has the form "Type of '<name>'", but this might change in the future
There is no dynamic type of a type instance since this would result in an
endless hierarchy of types, so dynamic_type is redefined to just return
Type.type here.
endless hierarchy of types, so dynamic_type is redefined to just return
Type.type here.
Is this type assignable to a type parameter with constraint `T`?
The result of this is a compile-time constant that can be used to specialize
code for a particular type.
it is most useful in conjunction with preconditions or `if` statements as in
or
The result of this is a compile-time constant that can be used to specialize
code for a particular type.
it is most useful in conjunction with preconditions or `if` statements as in
or
name of this type, including type parameters, e.g. 'option (list i32)'.
convenience prefix operator to create a string from a value.
This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.
NYI: Redefinition allows the type feature to be distinguished from its normal counterpart, see #3913
This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.
NYI: Redefinition allows the type feature to be distinguished from its normal counterpart, see #3913
Get a type as a value.
This is a feature with the effect equivalent to Fuzion's `expr.type` call tail.
It is recommended to use `expr.type` and not `expr.type_value`.
`type_value` is here to show how this can be implemented and to illustrate the
difference to `dynamic_type`.
This is a feature with the effect equivalent to Fuzion's `expr.type` call tail.
It is recommended to use `expr.type` and not `expr.type_value`.
`type_value` is here to show how this can be implemented and to illustrate the
difference to `dynamic_type`.
0.095dev (2025-08-15 12:02:22 GIT hash 301b5b75e77076d091b38f555473f9f0e31e5b5c built by fridi@fzen)