# another product.
# Provides the Clock utility class to keep time of real time flow
-module realtime is c_linker_option("-lrt")
+module realtime is ldflags "-lrt"
in "C header" `{
#ifdef _POSIX_C_SOURCE
# Update `self` clock.
fun update `{
- clock_gettime( CLOCK_MONOTONIC, recv );
+ clock_gettime(CLOCK_MONOTONIC, self);
`}
# Substract a Timespec from `self`.
# Number of whole seconds of elapsed time.
fun sec : Int `{
- return recv->tv_sec;
+ return self->tv_sec;
`}
# Rest of the elapsed time (a fraction of a second).
#
# Number of nanoseconds.
fun nanosec : Int `{
- return recv->tv_nsec;
+ return self->tv_nsec;
`}
# Seconds in Float