nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Fix support for Byte in the FFI
[nit.git]
/
lib
/
realtime.nit
diff --git
a/lib/realtime.nit
b/lib/realtime.nit
index
b66ade0
..
960a3cb
100644
(file)
--- a/
lib/realtime.nit
+++ b/
lib/realtime.nit
@@
-11,7
+11,7
@@
# another product.
# Provides the Clock utility class to keep time of real time flow
# 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
in "C header" `{
#ifdef _POSIX_C_SOURCE
@@
-48,7
+48,7
@@
extern class Timespec `{struct timespec*`}
# Update `self` clock.
fun update `{
# Update `self` clock.
fun update `{
- clock_gettime( CLOCK_MONOTONIC, recv );
+ clock_gettime(CLOCK_MONOTONIC, self);
`}
# Substract a Timespec from `self`.
`}
# Substract a Timespec from `self`.
@@
-62,14
+62,14
@@
extern class Timespec `{struct timespec*`}
# Number of whole seconds of elapsed time.
fun sec : Int `{
# 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 `{
`}
# 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
`}
# Seconds in Float